summaryrefslogtreecommitdiff
path: root/hooks/post_push
diff options
context:
space:
mode:
authorMark Lechtermann <mark.lechtermann@gmail.com>2020-08-14 16:47:18 +0200
committerMark Lechtermann <mark.lechtermann@gmail.com>2020-08-14 16:47:18 +0200
commitb514609f4fa319491d1956205d98012b5fc59d9d (patch)
tree3dc68dc48dc467117c3129d26d6128a5528b63a6 /hooks/post_push
parent63aa250910f56c85a4481506fddd2930ed83665d (diff)
Hash as Docker tag supported
Diffstat (limited to 'hooks/post_push')
-rwxr-xr-xhooks/post_push5
1 files changed, 5 insertions, 0 deletions
diff --git a/hooks/post_push b/hooks/post_push
new file mode 100755
index 0000000..c3a2958
--- /dev/null
+++ b/hooks/post_push
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+SHORTHASH="$(git rev-parse --short HEAD)"
+docker tag $IMAGE_NAME $DOCKER_REPO:$SHORTHASH
+docker push $DOCKER_REPO:$SHORTHASH \ No newline at end of file