Skip to content

Commit

Permalink
fix(build): Attempt to fix deployments (#2309)
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
PhilWindle authored Sep 14, 2023
1 parent 4d3e341 commit 39f16f9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions build-system/scripts/deploy_ecr
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion build-system/scripts/deploy_npm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 39f16f9

Please sign in to comment.