You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2018/06/25 04:15:42 UTC

mesos git commit: Supported tag build for Mesos mini jenkins script.

Repository: mesos
Updated Branches:
  refs/heads/master 8ec5943a8 -> 3228db4ac


Supported tag build for Mesos mini jenkins script.


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/3228db4a
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/3228db4a
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/3228db4a

Branch: refs/heads/master
Commit: 3228db4ac21299ccd14e25fb5738c3d890b6b0da
Parents: 8ec5943
Author: Jie Yu <yu...@gmail.com>
Authored: Sun Jun 24 21:15:25 2018 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Sun Jun 24 21:15:25 2018 -0700

----------------------------------------------------------------------
 support/jenkins/mini.sh | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/3228db4a/support/jenkins/mini.sh
----------------------------------------------------------------------
diff --git a/support/jenkins/mini.sh b/support/jenkins/mini.sh
index eff6ee2..4f94b6c 100755
--- a/support/jenkins/mini.sh
+++ b/support/jenkins/mini.sh
@@ -8,10 +8,22 @@ SUPPORT_DIR="${CURRENT_DIR}/.."
 : ${USERNAME:?"Environment variable 'USERNAME' must be set to the username of the 'Mesos DockerBot' Docker hub account."}
 : ${PASSWORD:?"Environment variable 'PASSWORD' must be set to the password of the 'Mesos DockerBot' Docker hub account."}
 
+MESOS_SHA=${MESOS_SHA:-`git rev-parse HEAD`}
+MESOS_VERSION=`git describe --exact-match $MESOS_SHA 2>/dev/null || echo $MESOS_SHA`
+
+echo "MESOS_SHA=$MESOS_SHA"
+echo "MESOS_VERSION=$MESOS_VERSION"
+
 DOCKER_IMAGE_MINI=${DOCKER_IMAGE_MINI:-"mesos/mesos-mini"}
 DOCKER_IMAGE_PACKAGING=${DOCKER_IMAGE_PACKAGING:-"mesos/mesos-centos-packaging"}
 DOCKER_IMAGE_DISTRO=${DOCKER_IMAGE_DISTRO:-"mesos/mesos-centos"}
-DOCKER_IMAGE_TAG=`date +%F`
+
+if [[ "$MESOS_VERSION" != "$MESOS_SHA" ]]; then
+  # HEAD is also a tag.
+  DOCKER_IMAGE_TAG="$MESOS_VERSION"
+else
+  DOCKER_IMAGE_TAG=`date +%F`
+fi
 
 function cleanup {
   docker rmi $(docker images -q ${DOCKER_IMAGE_PACKAGING}:${DOCKER_IMAGE_TAG}) || true