This is an automated email from the ASF dual-hosted git repository.
csantanapr pushed a commit to branch master
in repository
https://gitbox.apache.org/repos/asf/incubator-openwhisk-deploy-kube.git
The following commit(s) were added to refs/heads/master by this push:
new fa67042 Also tag with githash when tagging with latest (#361)
fa67042 is described below
commit fa6704293dc8210cccc0c0cfcdf6a34a7a725dac
Author: David Grove <[email protected]>
AuthorDate: Fri Nov 16 14:57:12 2018 -0500
Also tag with githash when tagging with latest (#361)
If tagging an image with latest, also tag it with the short
githash of current head so we can have a stable tag on dockerhub.
Fixes #359
---
tools/travis/publish.sh | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/tools/travis/publish.sh b/tools/travis/publish.sh
index baa6362..709d066 100755
--- a/tools/travis/publish.sh
+++ b/tools/travis/publish.sh
@@ -13,3 +13,10 @@
dockerhub_image="${dockerhub_image_prefix}/${dockerhub_image_name}:${dockerhub_i
docker login -u "${DOCKER_USER}" -p "${DOCKER_PASSWORD}"
docker build ${dir_to_build} --tag ${dockerhub_image}
docker push ${dockerhub_image}
+
+if [ ${dockerhub_image_tag} == "latest" ]; then
+ short_commit=`git rev-parse --short HEAD`
+
dockerhub_image_alias="${dockerhub_image_prefix}/${dockerhub_image_name}:${short_commit}"
+ docker tag ${dockerhub_image} ${dockerhub_image_alias}
+ docker push ${dockerhub_image_alias}
+fi