vegvisir/deploy/publish_image.sh
Piotr Biernat d84cf47b01
All checks were successful
continuous-integration/drone/push Build is passing
Merge branch 'dev/ci-docker-builder' into develop
2022-04-18 00:49:57 +02:00

18 lines
473 B
Bash
Executable File

#!/bin/sh
set -e
set -x
# BRANCH="dev/ci-docker-builder"
# BRANCH="develop"
# BRANCH=$CI_COMMIT_BRANCH
branch=$(echo $CI_COMMIT_BRANCH | grep -v /) || echo $CI_COMMIT_BRANCH ;
p1=$(echo $CI_COMMIT_BRANCH | cut -d / -f1 -s) &&
p2=$(echo $CI_COMMIT_BRANCH | cut -d / -f2 -s) &&
tag=${branch:=$p1-$p2} &&
echo "Publishing" $tag
echo $DOCKER_PASSWORD | docker login git.pbiernat.dev -u $DOCKER_USERNAME --password-stdin &&
docker push git.pbiernat.dev/golang/vegvisir:$tag