Skip to content

Commit

Permalink
Enhancement (ci): Add commit_sha label (#120)
Browse files Browse the repository at this point in the history
This is useful for traceability.

Co-authored-by: leo <leonardjonathanoh@live.com>
Co-authored-by: joe <joeltimothyoh@live.com>
  • Loading branch information
leojonathanoh and joeltimothyoh authored Mar 8, 2023
1 parent 7109676 commit b8becff
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ elif [ "$PIPELINE" = 'update' ]; then
BUILD_CONTEXT='update/'
fi
GAME_IMAGE_LATEST="$REPOSITORY:latest"
COMMIT_SHA=$( git rev-parse HEAD )

# Display pipeline
echo "PIPELINE: $PIPELINE"
Expand Down Expand Up @@ -149,6 +150,7 @@ if [ "$PIPELINE" = 'build' ]; then
--label "game_version_base=$GAME_VERSION" \
--label 'game_update_count=0' \
--label "game_engine=$GAME_ENGINE" \
--label "commit_sha=$COMMIT_SHA" \
"$BUILD_CONTEXT"
if [ "$LATEST" = 'true' ]; then
docker tag "$GAME_IMAGE" "$GAME_IMAGE_LATEST"
Expand All @@ -171,6 +173,7 @@ elif [ "$PIPELINE" = 'update' ]; then
-t "$GAME_IMAGE" \
--label "game_version=$GAME_VERSION" \
--label "game_update_count=$GAME_UPDATE_COUNT" \
--label "commit_sha=$COMMIT_SHA" \
"$BUILD_CONTEXT"
docker tag "$GAME_IMAGE" "$GAME_IMAGE_LAYERED"
date
Expand Down

0 comments on commit b8becff

Please sign in to comment.