From 39f16f9f642ff348920e1cd4511df9d0f72bacf9 Mon Sep 17 00:00:00 2001 From: PhilWindle <60546371+PhilWindle@users.noreply.github.com> Date: Thu, 14 Sep 2023 21:45:03 +0100 Subject: [PATCH] fix(build): Attempt to fix deployments (#2309) This PR attempts to fix 2 items of the deployment pipeline. # Checklist: Remove the checklist to signal you've completed it. Enable auto-merge if the PR is ready to merge. - [ ] If the pull request requires a cryptography review (e.g. cryptographic algorithm implementations) I have added the 'crypto' tag. - [ ] I have reviewed my diff in github, line by line and removed unexpected formatting changes, testing logs, or commented-out code. - [ ] Every change is related to the PR description. - [ ] I have [linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) this pull request to relevant issues (if any exist). --- build-system/scripts/deploy_ecr | 10 ++++++++-- build-system/scripts/deploy_npm | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/build-system/scripts/deploy_ecr b/build-system/scripts/deploy_ecr index 2fb0cd2fbe7..d8469733069 100755 --- a/build-system/scripts/deploy_ecr +++ b/build-system/scripts/deploy_ecr @@ -18,15 +18,21 @@ retry ensure_repo $REPOSITORY $ECR_DEPLOY_REGION # Push image to deployment repo with commit hash tag and optional architecture e.g: # falafel:deadbeefcafebabe1337c0de-x86_64 IMAGE_DEPLOY_COMMIT_URI=$ECR_DEPLOY_URL/$REPOSITORY:$COMMIT_HASH +CURRENT_TAG=$COMMIT_HASH +NEW_TAG_COMMIT_TAG=$PROJECT-$COMMIT_TAG +NEW_TAG_DEPLOY_TAG=$DEPLOY_TAG if [[ -n "$ARCH" ]]; then IMAGE_DEPLOY_COMMIT_URI=$IMAGE_DEPLOY_COMMIT_URI-$ARCH + CURRENT_TAG=$CURRENT_TAG-$ARCH + NEW_TAG_COMMIT_TAG=$NEW_TAG_COMMIT_TAG-$ARCH + NEW_TAG_DEPLOY_TAG=$NEW_TAG_DEPLOY_TAG-$ARCH fi retry docker tag $IMAGE_COMMIT_URI $IMAGE_DEPLOY_COMMIT_URI retry docker push $IMAGE_DEPLOY_COMMIT_URI # Tag image with full version if we have one. Allows deployment of precise image version if rollback needed. if [ -n "${COMMIT_TAG:-}" ]; then - retry tag_remote_image $REPOSITORY $COMMIT_HASH $PROJECT-$COMMIT_TAG $ECR_DEPLOY_REGION + retry tag_remote_image $REPOSITORY $CURRENT_TAG $NEW_TAG_COMMIT_TAG $ECR_DEPLOY_REGION fi -retry tag_remote_image $REPOSITORY $COMMIT_HASH $DEPLOY_TAG $ECR_DEPLOY_REGION +retry tag_remote_image $REPOSITORY $CURRENT_TAG $NEW_TAG_DEPLOY_TAG $ECR_DEPLOY_REGION diff --git a/build-system/scripts/deploy_npm b/build-system/scripts/deploy_npm index 8872e7e3e08..0ad35f4e212 100755 --- a/build-system/scripts/deploy_npm +++ b/build-system/scripts/deploy_npm @@ -9,7 +9,7 @@ readonly STANDALONE=${2:-} extract_repo $REPOSITORY /usr/src project -cd project/src/$(query_manifest projectDir $REPOSITORY) +cd $(query_manifest projectDir $REPOSITORY) echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc