Skip to content

Commit

Permalink
Merge pull request #483 from liquibase/DAT-15738
Browse files Browse the repository at this point in the history
DAT-15738



  DevOps: Refactor extensions upload xsds job to reusable workflows
  • Loading branch information
vitaliimak authored Jan 4, 2024
2 parents 0f6e394 + 10bf03a commit 343fd80
Showing 1 changed file with 2 additions and 40 deletions.
42 changes: 2 additions & 40 deletions .github/workflows/release-published.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,44 +9,6 @@ jobs:
release:
uses: liquibase/build-logic/.github/workflows/[email protected]
secrets: inherit
with:
nameSpace: mongodb

deploy_xsd:
name: Upload xsds
runs-on: ubuntu-20.04
steps:
- name: Download liquibase mongodb xsd
uses: actions/checkout@v4
with:
# Relative path under $GITHUB_WORKSPACE to place the repository
path: liquibase-mongodb
repository: "liquibase/liquibase-mongodb"

- name: Upload to s3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.LIQUIBASEORIGIN_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.LIQUIBASEORIGIN_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
# aws s3 sync syncs directories and S3 prefixes.
run: |
aws s3 sync liquibase-mongodb/src/main/resources/www.liquibase.org/xml/ns/mongodb/ s3://liquibaseorg-origin/xml/ns/mongodb/ --content-type application/octet-stream --only-show-errors
- name: Index.htm file upload
env:
AWS_ACCESS_KEY_ID: ${{ secrets.LIQUIBASEORIGIN_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.LIQUIBASEORIGIN_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
# List all xsd and htm files in repository. Copy index.htm to temporary folder
# Add links for all xsd files to index.htm file (except liquibase-mongodb-latest.xsd and index.htm)
# Sync index.htm with the s3
run: |
search_dir=liquibase-mongodb/src/main/resources/www.liquibase.org/xml/ns/mongodb
filenames=`ls -1 $search_dir`
mkdir index-file
cp $search_dir/index.htm index-file/
for entry in $filenames
do
if [[ "$entry" != "liquibase-mongodb-latest.xsd" ]] && [[ "$entry" != "index.htm" ]] ;then
sed -ie "s/<\/ul>/ <li><a href=\"\/xml\/ns\/mongodb\/${entry}\">${entry}<\/a><\/li>\n<\/ul>/" index-file/index.htm
fi
done
aws s3 sync index-file s3://liquibaseorg-origin/xml/ns/mongodb/ --only-show-errors

0 comments on commit 343fd80

Please sign in to comment.