Add post_build hook to tag latest
This commit is contained in:
parent
0a92050b9c
commit
742d4eb3de
14
hooks/post_build
Executable file
14
hooks/post_build
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
tagStart=$(echo $IMAGE_NAME | awk '{print index($1,":")}')
|
||||||
|
repoName=${IMAGE_NAME:0:tagStart-1}
|
||||||
|
tagName=${IMAGE_NAME:tagStart:99}
|
||||||
|
|
||||||
|
if [ "$tagName" = "latest-apache" ]; then
|
||||||
|
echo "Tagging $IMAGE_NAME as :latest"
|
||||||
|
|
||||||
|
docker tag $IMAGE_NAME ${repoName}:latest
|
||||||
|
docker push ${repoName}:latest
|
||||||
|
fi
|
Loading…
x
Reference in New Issue
Block a user