Skip to content

Commit

Permalink
Push docker tag with git SHA solely in addition to SHA and timestamp
Browse files Browse the repository at this point in the history
Useful for situations when the exact version of docker image needs to be provided
  • Loading branch information
rielas committed Sep 30, 2024
1 parent 0053b4c commit 52ed70f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hooks/post_push
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ TIMESTAMP=$(date +%Y%m%d%H%M%S)
GIT_SHA=$(echo $SOURCE_COMMIT | cut -b 1-6)
docker tag $IMAGE_NAME $DOCKER_REPO:$SOURCE_BRANCH-$GIT_SHA-$TIMESTAMP
docker push $DOCKER_REPO:$SOURCE_BRANCH-$GIT_SHA-$TIMESTAMP

docker tag $IMAGE_NAME $DOCKER_REPO:$SOURCE_BRANCH-$GIT_SHA
docker push $DOCKER_REPO:$SOURCE_BRANCH-$GIT_SHA

0 comments on commit 52ed70f

Please sign in to comment.