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/10/28 05:33:29 UTC

[mesos] 03/10: Updated Jenkins Docker Centos script.

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

jieyu pushed a commit to branch 1.7.x
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit 36e49a39867bae96a34a6a014c5d0d3d0ee66120
Author: Jie Yu <yu...@gmail.com>
AuthorDate: Sat Oct 27 11:48:08 2018 -0700

    Updated Jenkins Docker Centos script.
    
    To adapt to the new Docker Centos build pipeline.
    
    (cherry picked from commit e8602b6a2c816aac2853ea10e28fcf5e36879076)
---
 support/jenkins/docker-centos.sh | 34 ++++++++++++++++++++--------------
 1 file changed, 20 insertions(+), 14 deletions(-)

diff --git a/support/jenkins/docker-centos.sh b/support/jenkins/docker-centos.sh
index 812799a..12cf81c 100755
--- a/support/jenkins/docker-centos.sh
+++ b/support/jenkins/docker-centos.sh
@@ -8,26 +8,32 @@ set -o errexit -o nounset -o pipefail -o verbose
 CURRENT_DIR="$(cd "$(dirname "$0")"; pwd -P)"
 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."}
+: "${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."}"
 
-DOCKER_IMAGE_PACKAGING=${DOCKER_IMAGE_PACKAGING:-"mesos/mesos-centos-packaging"}
-DOCKER_IMAGE_DISTRO=${DOCKER_IMAGE_DISTRO:-"mesos/mesos-centos"}
-DOCKER_IMAGE_TAG=`date +%F`
+DOCKER_IMAGE=${DOCKER_IMAGE:-"mesos/mesos-centos"}
+
+MESOS_SHA=${MESOS_SHA:-$(git rev-parse HEAD)}
+MESOS_TAG_OR_SHA=$(git describe --exact-match "${MESOS_SHA}" 2>/dev/null || echo "${MESOS_SHA}")
+DOCKER_IMAGE_TAG="${MESOS_TAG_OR_SHA}"
+
+echo "MESOS_SHA=${MESOS_SHA}"
+echo "DOCKER_IMAGE_TAG=${DOCKER_IMAGE_TAG}"
 
 function cleanup {
-  docker rmi $(docker images -q ${DOCKER_IMAGE_PACKAGING}:${DOCKER_IMAGE_TAG}) || true
-  docker rmi $(docker images -q ${DOCKER_IMAGE_DISTRO}:${DOCKER_IMAGE_TAG}) || true
+  docker rmi "$(docker images -q "${DOCKER_IMAGE}:${DOCKER_IMAGE_TAG}")" || true
 }
 
 trap cleanup EXIT
 
-DOCKER_IMAGE_PACKAGING=${DOCKER_IMAGE_PACKAGING} \
-DOCKER_IMAGE_DISTRO=${DOCKER_IMAGE_DISTRO} \
+CENTOS_DISTRO="7" \
+DOCKER_IMAGE=${DOCKER_IMAGE} \
 DOCKER_IMAGE_TAG=${DOCKER_IMAGE_TAG} \
-"${SUPPORT_DIR}/packaging/centos/build-docker-image.sh"
+"${SUPPORT_DIR}/packaging/centos/build-docker-centos.sh"
+
+DATE=$(date +%F)
 
-docker tag ${DOCKER_IMAGE_DISTRO}:${DOCKER_IMAGE_TAG} ${DOCKER_IMAGE_DISTRO}:latest
-docker login -u ${USERNAME} -p ${PASSWORD}
-docker push ${DOCKER_IMAGE_DISTRO}:${DOCKER_IMAGE_TAG}
-docker push ${DOCKER_IMAGE_DISTRO}:latest
+docker tag "${DOCKER_IMAGE}:${DOCKER_IMAGE_TAG}" "${DOCKER_IMAGE}:${DATE}"
+docker login -u "${USERNAME}" -p "${PASSWORD}"
+docker push "${DOCKER_IMAGE}:${DOCKER_IMAGE_TAG}"
+docker push "${DOCKER_IMAGE}:${DATE}"