This is an automated email from the ASF dual-hosted git repository.

japetrsn pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/incubator-openwhisk-package-kafka.git


The following commit(s) were added to refs/heads/master by this push:
     new 5aec996  When tagging image with latest, also tag with githash (#333)
5aec996 is described below

commit 5aec99680e888fb6d2e79a262b06cfc72bdfc466
Author: David Grove <[email protected]>
AuthorDate: Wed Apr 10 14:30:15 2019 -0400

    When tagging image with latest, also tag with githash (#333)
---
 tools/travis/deploy.sh | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/tools/travis/deploy.sh b/tools/travis/deploy.sh
index 8fd760c..c4f0eb4 100755
--- a/tools/travis/deploy.sh
+++ b/tools/travis/deploy.sh
@@ -17,3 +17,15 @@ docker build . --tag ${dockerhub_image}
 
 echo docker push ${dockerhub_image}
 docker push ${dockerhub_image}
+
+# if image tag is latest, also push a tag with the hash commit
+if [ ${dockerhub_image_tag} == "latest" ]; then
+  short_commit=`git rev-parse --short HEAD`
+  
dockerhub_githash_image="${dockerhub_image_prefix}/${dockerhub_image_name}:${short_commit}"
+
+  echo docker tag ${dockerhub_image} ${dockerhub_githash_image}
+  docker tag ${dockerhub_image} ${dockerhub_githash_image}
+
+  echo docker push ${dockerhub_githash_image}
+  docker push ${dockerhub_githash_image}
+fi

Reply via email to