From ec6597eaf476a8414f990f85d470556ebaed5283 Mon Sep 17 00:00:00 2001 From: aboyko Date: Wed, 2 Aug 2023 11:04:06 -0400 Subject: [PATCH] GHA: Agg Update Site work --- .../scripts/generate-composite-site-files.sh | 4 ++-- .../update-aggregate-update-sites.yml | 19 +++++++++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/scripts/generate-composite-site-files.sh b/.github/scripts/generate-composite-site-files.sh index 631dd3110..e16d4dd65 100755 --- a/.github/scripts/generate-composite-site-files.sh +++ b/.github/scripts/generate-composite-site-files.sh @@ -9,13 +9,13 @@ echo "" >> compositeArtifacts.xml echo "" >> compositeArtifacts.xml echo "" >> compositeArtifacts.xml -ehco " " >> compositeArtifacts.xml +echo " " >> compositeArtifacts.xml echo " " >> compositeArtifacts.xml echo " " >> compositeArtifacts.xml echo " " >> compositeArtifacts.xml echo " " >> compositeArtifacts.xml echo " " >> compositeArtifacts.xml -ehco "" >> compositeArtifacts.xml +echo "" >> compositeArtifacts.xml echo "" >> compositeContent.xml echo "" >> compositeContent.xml diff --git a/.github/workflows/update-aggregate-update-sites.yml b/.github/workflows/update-aggregate-update-sites.yml index c13d1c226..9c423a35e 100644 --- a/.github/workflows/update-aggregate-update-sites.yml +++ b/.github/workflows/update-aggregate-update-sites.yml @@ -4,7 +4,11 @@ on: workflow_dispatch: inputs: version: - description: Version suffix in S3 + description: Version suffix in S3 (i.e. 4.19.1.RELEASE) + required: true + type: string + latest: + description: Latest eclipse release version (i.e. e4.28) required: true type: string @@ -34,9 +38,20 @@ jobs: do if [[ "$dir" =~ $pattern ]]; then echo "Found ${dir}" - site_url="https://download.springsource.com/release/TOOLS/sts4/update/${dir}" + dir_name=${dir:0:-1} + site_url="https://download.springsource.com/release/TOOLS/sts4/update/${dir_name}" ${{ github.workspace }}/.github/scripts/generate-composite-site-files.sh ${{ steps.timestamp.outputs.date }} $site_url cat ./compositeArtifacts.xml cat ./compositeContent.xml + if [[ ${dir_name} == ${{ inputs.latest }} ]]; then + echo "aws s3 cp ./compositeArtifacts.xml s3://dist.springsource.com/release/TOOLS/sts4/update/latest --dryrun --acl public-read" + echo "aws s3 cp ./compositeContent.xml s3://dist.springsource.com/release/TOOLS/sts4/update/latest --dryrun --acl public-read" + echo "aws s3 cp ./p2.index s3://dist.springsource.com/release/TOOLS/sts4/update/latest --dryrun --acl public-read" + echo "Clear caches for path release/TOOLS/sts4/update/latest" + fi + echo "aws s3 mv ./compositeArtifacts.xml s3://dist.springsource.com/release/TOOLS/sts4/update/${dir} --dryrun --acl public-read" + echo "aws s3 mv ./compositeContent.xml s3://dist.springsource.com/release/TOOLS/sts4/update/${dir} --dryrun --acl public-read" + echo "aws s3 mv ./p2.index s3://dist.springsource.com/release/TOOLS/sts4/update/${dir} --dryrun --acl public-read" + echo "Clear caches for path release/TOOLS/sts4/update/${dir_name}" fi done \ No newline at end of file