Skip to content

Commit

Permalink
DO NOT MERGE: Force s3 deploy with dry run flag
Browse files Browse the repository at this point in the history
Signed-off-by: Kyle Harding <[email protected]>
  • Loading branch information
klutchell committed Nov 1, 2024
1 parent ce6d147 commit b6da0b1
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/yocto-build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Prepare files for S3
if: steps.should-deploy.outputs.deploy && steps.balena-lib.outputs.deploy_artifact != 'docker-image'
# if: steps.should-deploy.outputs.deploy && steps.balena-lib.outputs.deploy_artifact != 'docker-image'
env:
HELPER_IMAGE: balena/balena-img:6.20.26
# This path is different from DEPLOY_PATH due to the structure the prepare.ts expects: "/host/image/${device_slug}/${version}/..."
Expand All @@ -606,13 +606,13 @@ jobs:

# https://github.com/unfor19/install-aws-cli-action
- name: Setup awscli
if: steps.should-deploy.outputs.deploy
# if: steps.should-deploy.outputs.deploy
uses: unfor19/install-aws-cli-action@e8b481e524a99f37fbd39fdc1dcb3341ab091367 # v1

# # https://github.com/aws-actions/configure-aws-credentials
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
if: steps.should-deploy.outputs.deploy
# if: steps.should-deploy.outputs.deploy
with:
role-to-assume: ${{ vars.AWS_IAM_ROLE }}
role-session-name: github-${{ github.job }}-${{ github.run_id }}-${{ github.run_attempt }}
Expand All @@ -625,7 +625,7 @@ jobs:
# https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3/cp.html
# https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3/sync.html
- name: Deploy to S3
if: steps.should-deploy.outputs.deploy && steps.balena-lib.outputs.deploy_artifact != 'docker-image'
# if: steps.should-deploy.outputs.deploy && steps.balena-lib.outputs.deploy_artifact != 'docker-image'
env:
S3_ACL: ${{ steps.s3-acl-private.outputs.string || 'public-read' }}
S3_SSE: AES256
Expand All @@ -643,11 +643,11 @@ jobs:
echo "${VERSION}" > "${SOURCE_DIR}/${SLUG}/latest"
touch "${SOURCE_DIR}/${SLUG}/${VERSION}/IGNORE"
aws s3 rm --recursive "${S3_URL}/${SLUG}/${VERSION}"
aws s3 cp --sse="${S3_SSE}" --acl="${S3_ACL}" "${SOURCE_DIR}/${SLUG}/${VERSION}/IGNORE" "${S3_URL}/${SLUG}/${VERSION}/"
aws s3 sync --sse="${S3_SSE}" --acl="${S3_ACL}" "${SOURCE_DIR}/${SLUG}/${VERSION}/" "${S3_URL}/${SLUG}/${VERSION}/"
aws s3 cp --sse="${S3_SSE}" --acl=public-read "${SOURCE_DIR}/${SLUG}/latest" "${S3_URL}/${SLUG}/"
aws s3 rm "${S3_URL}/${SLUG}/${VERSION}/IGNORE"
aws s3 rm --dryrun --recursive "${S3_URL}/${SLUG}/${VERSION}"
aws s3 cp --dryrun --sse="${S3_SSE}" --acl="${S3_ACL}" "${SOURCE_DIR}/${SLUG}/${VERSION}/IGNORE" "${S3_URL}/${SLUG}/${VERSION}/"
aws s3 sync --dryrun --sse="${S3_SSE}" --acl="${S3_ACL}" "${SOURCE_DIR}/${SLUG}/${VERSION}/" "${S3_URL}/${SLUG}/${VERSION}/"
aws s3 cp --dryrun --sse="${S3_SSE}" --acl=public-read "${SOURCE_DIR}/${SLUG}/latest" "${S3_URL}/${SLUG}/"
aws s3 rm --dryrun "${S3_URL}/${SLUG}/${VERSION}/IGNORE"
##############################
# hostapp Deploy
Expand Down

0 comments on commit b6da0b1

Please sign in to comment.