Skip to content

Commit

Permalink
Revert "fix: commit tags and rebuilds (#2156)"
Browse files Browse the repository at this point in the history
This reverts commit 7669b43.
  • Loading branch information
ludamad authored Sep 8, 2023
1 parent 00b6d35 commit ae7b444
Showing 1 changed file with 33 additions and 34 deletions.
67 changes: 33 additions & 34 deletions build-system/scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -63,40 +63,6 @@ retry ensure_repo $REPOSITORY $ECR_REGION refresh_lifecycle
CONTENT_HASH=$(calculate_content_hash $REPOSITORY)
echo "Content hash: $CONTENT_HASH"

# Extract version from commit tag
# Check if there is a commit tag
if [[ -n "$COMMIT_TAG" ]]; then

# 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). Ignoring..."
COMMIT_TAG_VERSION=""
fi
else
COMMIT_TAG_VERSION=$COMMIT_TAG
fi

# TODO #2155 dont seem to be able to install npx
# # We are building a tagged commit. Check it's a valid semver.
# VERSION=$(npx semver $COMMIT_TAG_VERSION)
# if [ -z "$VERSION" ]; then
# COMMIT_TAG_VERSION=""
# else
# COMMIT_TAG_VERSION=$VERSION
# fi
# fix: we need to use a different content hash for a commit tag
CONTENT_HASH="$CONTENT_HASH$COMMIT_TAG_VERSION"
else
COMMIT_TAG_VERSION=""
fi

cd $BUILD_DIR

# If we have previously successful commit, we can early out if nothing relevant has changed since.
Expand Down Expand Up @@ -148,6 +114,39 @@ for PARENT in $PARENTS; do
retry docker tag $PARENT_IMAGE_URI $ECR_DEPLOY_URL/$PARENT
done


# Extract version from commit tag
# Check if there is a commit tag
if [[ -n "$COMMIT_TAG" ]]; then

# 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). Ignoring..."
COMMIT_TAG_VERSION=""
fi
else
COMMIT_TAG_VERSION=$COMMIT_TAG
fi

# We are building a tagged commit. Check it's a valid semver.
VERSION=$(npx semver $COMMIT_TAG_VERSION)
if [ -z "$VERSION" ]; then
COMMIT_TAG_VERSION=""
else
COMMIT_TAG_VERSION=$VERSION
fi
else
COMMIT_TAG_VERSION=""
fi


# Pull, build and push each named stage to cache.
STAGE_CACHE_FROM=""
CACHE_FROM=""
Expand Down

0 comments on commit ae7b444

Please sign in to comment.