Skip to content

Commit

Permalink
Create post_build to push image to docker hub with git sha version tag
Browse files Browse the repository at this point in the history
  • Loading branch information
nihonjinrxs committed Mar 20, 2018
1 parent a519fb9 commit 353c0b0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/hooks/post_build
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

if [[ -z "$SOURCE_COMMIT" ]]; then
export SOURCE_COMMIT="${SOURCE_COMMIT:-$(git rev-parse HEAD)}"
echo "Updating SOURCE_COMMIT from git rev-parse HEAD"
echo "SOURCE_COMMIT: $SOURCE_COMMIT"
fi

docker tag $IMAGE_NAME $DOCKER_REPO:$SOURCE_COMMIT
docker push $DOCKER_REPO:$SOURCE_COMMIT

0 comments on commit 353c0b0

Please sign in to comment.