summaryrefslogtreecommitdiff
path: root/tools/gate_run.sh
diff options
context:
space:
mode:
authorJeffrey Zhang <zhang.lei.fly@gmail.com>2017-03-20 21:54:37 +0800
committerJeffrey Zhang <zhang.lei.fly@gmail.com>2017-03-20 21:56:37 +0800
commitc282fa45fd405d65daa358564f0822274a1e40e6 (patch)
tree8c6d87481b2160203b03c6424f0cc6e94b17e154 /tools/gate_run.sh
parentac1d2df3b899d50f62c106620fb9e3e4888046ed (diff)
downloadkolla-c282fa45fd405d65daa358564f0822274a1e40e6.tar.gz
kolla-c282fa45fd405d65daa358564f0822274a1e40e6.zip
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
Diffstat (limited to 'tools/gate_run.sh')
-rwxr-xr-xtools/gate_run.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/gate_run.sh b/tools/gate_run.sh
index b312b14ad..1a58f5605 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