Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Enable project-specific releases for dockerhub too #1721

Merged
merged 2 commits into from
Sep 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion build-system/scripts/deploy_dockerhub
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,36 @@ if [ -z "$COMMIT_TAG" ]; then
fi

REPOSITORY=$1
IMAGE_TAG=$COMMIT_TAG
IMAGE_COMMIT_URI=$ECR_DEPLOY_URL/$REPOSITORY:$COMMIT_HASH
IMAGE_DEPLOY_URI=aztecprotocol/$REPOSITORY:$IMAGE_TAG
IMAGE_LATEST_URI=aztecprotocol/$REPOSITORY:latest

# Check if it's a repo-specific tag
if [[ "$COMMIT_TAG" == *"/"* ]]; then
REPO_NAME="${COMMIT_TAG%%/*}"
COMMIT_TAG_VERSION="${COMMIT_TAG#*/}"
echo "Tag was made for: $REPO_NAME"
echo "Version: $COMMIT_TAG_VERSION"

# Check if REPO_NAME is equal to REPOSITORY
if [ "$REPO_NAME" != "$REPOSITORY" ]; then
echo "REPO_NAME ($REPO_NAME) does not match REPOSITORY ($REPOSITORY). Exiting..."
exit 1
fi
else
COMMIT_TAG_VERSION=$COMMIT_TAG
fi

# Check it's a valid semver.
VERSION=$(npx semver $COMMIT_TAG_VERSION)
if [ -z "$VERSION" ]; then
echo "$COMMIT_TAG_VERSION is not a semantic version."
exit 1
fi

IMAGE_TAG=$COMMIT_TAG_VERSION


echo "Deploying to dockerhub: $IMAGE_DEPLOY_URI"

# Login.
Expand Down