From a1ec61f857b6549b676189bff8cbf58a527a08a9 Mon Sep 17 00:00:00 2001 From: Eugenio Romano Date: Tue, 14 Feb 2023 16:26:26 +0100 Subject: [PATCH] use one bucket variable to avoid: (#8263) Can be miss configured with different buckets We need to maintain two variables: They seems to be used in different ways because one contain s3:// the other not --- .github/actions/e2e/action.yml | 8 ++++---- .github/actions/upload-cache-and-artifacts/action.yml | 4 ++-- .github/workflows/git-tag.yml | 5 ++--- .github/workflows/pull-request.yml | 1 - .github/workflows/release.yml | 1 - 5 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/actions/e2e/action.yml b/.github/actions/e2e/action.yml index 307e6ae574..186596d35f 100644 --- a/.github/actions/e2e/action.yml +++ b/.github/actions/e2e/action.yml @@ -60,9 +60,9 @@ runs: run: | set -u; mkdir -p "${SMART_RUNNER_PATH}" - if [[ $(aws s3 ls "${S3_BUILD_BUCKET}/adf/${REMOTE_PATH}" > /dev/null; echo $?) -eq 0 ]]; then + if [[ $(aws s3 ls "s3://${S3_BUILD_BUCKET_SHORT_NAME}/adf/${REMOTE_PATH}" > /dev/null; echo $?) -eq 0 ]]; then echo "downloading test files" - aws s3 cp "${S3_BUILD_BUCKET}/adf/${REMOTE_PATH}" .; + aws s3 cp "s3://${S3_BUILD_BUCKET_SHORT_NAME}/adf/${REMOTE_PATH}" .; tar xzf ${{ inputs.e2e-tar-name }}; else echo "nothing to download"; @@ -161,7 +161,7 @@ runs: name: e2e-artifact-output path: /home/runner/work/alfresco-ng2-components/alfresco-ng2-components/e2e-output-* - - name: upload smartrunner tests results on s3 to cache tests + - name: upload smart-runner tests results on s3 to cache tests shell: bash if: always() env: @@ -169,4 +169,4 @@ runs: # description: always upload newer results run: | tar czf "${{ inputs.e2e-tar-name }}" "${SMART_RUNNER_PATH}" - aws s3 cp "${{ inputs.e2e-tar-name }}" "${S3_BUILD_BUCKET}/adf/$REMOTE_PATH" + aws s3 cp "${{ inputs.e2e-tar-name }}" "s3://${S3_BUILD_BUCKET_SHORT_NAME}/adf/${REMOTE_PATH}" diff --git a/.github/actions/upload-cache-and-artifacts/action.yml b/.github/actions/upload-cache-and-artifacts/action.yml index a6c769bdf6..f482168d41 100644 --- a/.github/actions/upload-cache-and-artifacts/action.yml +++ b/.github/actions/upload-cache-and-artifacts/action.yml @@ -7,13 +7,13 @@ runs: - name: tar and upload artifacts shell: bash env: - REMOTE_PATH: "alfresco-ng2-components/build-cache/${{ github.run_id }}" + REMOTE_PATH: "alfresco-ng2-components/build-cache/${{ github.run_id }}" run: | packages=( dist nxcache node_modules ) for i in "${packages[@]}"; do time tar czf $i.tar.gz $i du -h $i.tar.gz - time aws s3 cp --no-progress $i.tar.gz s3://${S3_BUILD_BUCKET_SHORT_NAME}/${REMOTE_PATH}/$i.tar.gz + time aws s3 cp --no-progress $i.tar.gz "s3://${S3_BUILD_BUCKET_SHORT_NAME}/${REMOTE_PATH}/$i.tar.gz" done diff --git a/.github/workflows/git-tag.yml b/.github/workflows/git-tag.yml index e8c6aae325..d29018450c 100644 --- a/.github/workflows/git-tag.yml +++ b/.github/workflows/git-tag.yml @@ -52,7 +52,6 @@ env: HR_USER_PASSWORD: ${{ secrets.HR_USER_PASSWORD }} SMART_RUNNER_PATH: ".protractor-smartrunner" S3_DBP_PATH: ${{ secrets.S3_DBP_PATH }} - S3_BUILD_BUCKET: ${{ secrets.S3_BUILD_BUCKET }} S3_BUILD_BUCKET_SHORT_NAME: ${{ secrets.S3_BUILD_BUCKET_SHORT_NAME }} NODE_OPTIONS: "--max-old-space-size=5120" DOCKER_REPOSITORY_DOMAIN: ${{ secrets.DOCKER_REPOSITORY_DOMAIN }} @@ -84,8 +83,8 @@ jobs: uses: actions/checkout@v3 - id: set-dryrun uses: ./.github/actions/enable-dryrun - with: - dry-run-flag: ${{ inputs.dry-run-release }} + with: + dry-run-flag: ${{ inputs.dry-run-release }} - name: install NPM uses: actions/setup-node@v3 with: diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index da74958f74..a1eff77bd6 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -60,7 +60,6 @@ env: HR_USER_PASSWORD: ${{ secrets.HR_USER_PASSWORD }} SMART_RUNNER_PATH: ".protractor-smartrunner" S3_DBP_PATH: ${{ secrets.S3_DBP_PATH }} - S3_BUILD_BUCKET: ${{ secrets.S3_BUILD_BUCKET }} S3_BUILD_BUCKET_SHORT_NAME: ${{ secrets.S3_BUILD_BUCKET_SHORT_NAME }} NODE_OPTIONS: "--max-old-space-size=5120" DOCKER_REPOSITORY_DOMAIN: ${{ secrets.DOCKER_REPOSITORY_DOMAIN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8bd9b8e185..505779a488 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -55,7 +55,6 @@ env: HR_USER_PASSWORD: ${{ secrets.HR_USER_PASSWORD }} SMART_RUNNER_PATH: ".protractor-smartrunner" S3_DBP_PATH: ${{ secrets.S3_DBP_PATH }} - S3_BUILD_BUCKET: ${{ secrets.S3_BUILD_BUCKET }} S3_BUILD_BUCKET_SHORT_NAME: ${{ secrets.S3_BUILD_BUCKET_SHORT_NAME }} NODE_OPTIONS: "--max-old-space-size=5120" DOCKER_REPOSITORY_DOMAIN: ${{ secrets.DOCKER_REPOSITORY_DOMAIN }}