You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by dg...@apache.org on 2019/04/10 01:00:47 UTC

[incubator-openwhisk-package-alarms] branch master updated: When tagging image with latest, also tag with githash (#185)

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

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


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

commit 983cc2174a9ef94688560d819320716c2d28e172
Author: David Grove <dg...@users.noreply.github.com>
AuthorDate: Tue Apr 9 21:00:43 2019 -0400

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

diff --git a/tools/travis/deploy.sh b/tools/travis/deploy.sh
index adc5c9d..007e244 100755
--- a/tools/travis/deploy.sh
+++ b/tools/travis/deploy.sh
@@ -30,3 +30,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_githash_image}
+
+  echo docker push ${dockerhub_githash_image}
+  docker push ${dockerhub_githash_image}
+fi