[skip-e2e] Use slugified branch name as docker image tag
This commit is contained in:
parent
36fc480d28
commit
d606f8f064
@ -1,9 +1,14 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
|
slugify() {
|
||||||
|
echo "$1" | sed -r 's/[^a-zA-Z0-9]+/-/g'
|
||||||
|
}
|
||||||
|
|
||||||
export IMAGE="openebs/rawfile-localpv"
|
export IMAGE="openebs/rawfile-localpv"
|
||||||
export COMMIT=$(git rev-parse --short HEAD)
|
export COMMIT=$(git rev-parse --short HEAD)
|
||||||
export BRANCH=${TRAVIS_BRANCH:-$(git rev-parse --abbrev-ref HEAD)}
|
export BRANCH=${TRAVIS_BRANCH:-$(git rev-parse --abbrev-ref HEAD)}
|
||||||
|
export BRANCH_SLUG=$(slugify $BRANCH)
|
||||||
|
|
||||||
export CI_REGISTRY="docker.io"
|
export CI_REGISTRY="docker.io"
|
||||||
export CI_TAG="${COMMIT}-ci"
|
export CI_TAG="${COMMIT}-ci"
|
||||||
|
@ -5,6 +5,6 @@ source .ci/common
|
|||||||
docker pull ${CI_IMAGE_URI}
|
docker pull ${CI_IMAGE_URI}
|
||||||
|
|
||||||
docker login -u "${DNAME}" -p "${DPASS}";
|
docker login -u "${DNAME}" -p "${DPASS}";
|
||||||
for TAG in $COMMIT $BRANCH; do
|
for TAG in $COMMIT $BRANCH_SLUG; do
|
||||||
TagAndPushImage "docker.io/${IMAGE}" $TAG;
|
TagAndPushImage "docker.io/${IMAGE}" $TAG;
|
||||||
done;
|
done;
|
||||||
|
Loading…
Reference in New Issue
Block a user