[skip-e2e] Use slugified branch name as docker image tag

This commit is contained in:
Mehran Kholdi 2020-07-13 21:17:47 +04:30
parent 36fc480d28
commit d606f8f064
2 changed files with 6 additions and 1 deletions

View File

@ -1,9 +1,14 @@
#!/bin/bash
set -ex
slugify() {
echo "$1" | sed -r 's/[^a-zA-Z0-9]+/-/g'
}
export IMAGE="openebs/rawfile-localpv"
export COMMIT=$(git rev-parse --short HEAD)
export BRANCH=${TRAVIS_BRANCH:-$(git rev-parse --abbrev-ref HEAD)}
export BRANCH_SLUG=$(slugify $BRANCH)
export CI_REGISTRY="docker.io"
export CI_TAG="${COMMIT}-ci"

View File

@ -5,6 +5,6 @@ source .ci/common
docker pull ${CI_IMAGE_URI}
docker login -u "${DNAME}" -p "${DPASS}";
for TAG in $COMMIT $BRANCH; do
for TAG in $COMMIT $BRANCH_SLUG; do
TagAndPushImage "docker.io/${IMAGE}" $TAG;
done;