diff --git a/hooks/post_push b/hooks/post_push index c944ca68..8808ec90 100755 --- a/hooks/post_push +++ b/hooks/post_push @@ -1,4 +1,5 @@ #!/bin/bash TIMESTAMP=$(date +%Y%m%d%H%M%S) -docker tag $IMAGE_NAME $DOCKER_REPO:$SOURCE_BRANCH-$SOURCE_COMMIT-$TIMESTAMP -docker push $DOCKER_REPO:$SOURCE_BRANCH-$SOURCE_COMMIT-$TIMESTAMP +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 diff --git a/public/hooks/post_push b/public/hooks/post_push new file mode 100755 index 00000000..8808ec90 --- /dev/null +++ b/public/hooks/post_push @@ -0,0 +1,5 @@ +#!/bin/bash +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