From c282fa45fd405d65daa358564f0822274a1e40e6 Mon Sep 17 00:00:00 2001 From: Jeffrey Zhang Date: Mon, 20 Mar 2017 21:54:37 +0800 Subject: [PATCH] Get correct tag name when job is running in release pipeline It is different to get the branch name and tag name in post and release pipeline. With this patch, we can push tag registry tarballs. Change-Id: Ifd1a3fe3da5548c340947946c27649a3059eb8b0 --- tools/gate_run.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/gate_run.sh b/tools/gate_run.sh index b312b14ad7..1a58f5605e 100755 --- a/tools/gate_run.sh +++ b/tools/gate_run.sh @@ -76,9 +76,15 @@ function collect_logs { } function pack_registry { - BRANCH=$(echo $ZUUL_REFNAME | cut -d/ -f2) + if [[ "$ZUUL_PIPELINE" == "tag" ]]; then + # ZUUL_REFNAME=refs/tags/4.0.0 + REF_NAME=$(echo $ZUUL_REFNAME | cut -d/ -f3) + else + # ZUUL_REFNAME=stable/ocata or master + REF_NAME=$(echo $ZUUL_REFNAME | cut -d/ -f2) + fi sudo mkdir "images" - FILENAME=${BASE_DISTRO}-${INSTALL_TYPE}-registry-${BRANCH}.tar.gz + FILENAME=${BASE_DISTRO}-${INSTALL_TYPE}-registry-${REF_NAME}.tar.gz sudo docker stop registry sudo tar -zcf "images/$FILENAME" -C /tmp/kolla_registry . sudo docker start registry