From a6e0ddd95947e35d68d75da13601bb14a71c87e6 Mon Sep 17 00:00:00 2001 From: Clemens Wolff Date: Thu, 16 May 2019 18:24:12 -0400 Subject: [PATCH] Add option to publish to non DockerHub registry --- tools/cd.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/cd.sh b/tools/cd.sh index 1b6b46df..591408a5 100755 --- a/tools/cd.sh +++ b/tools/cd.sh @@ -6,10 +6,15 @@ if [[ -z "$1" ]]; then echo "Usage: $0 " >&2; exit 1; fi set -o errexit +if [[ -z "${DOCKER_REGISTRY}" ]]; then + echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin +else + echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin "${DOCKER_REGISTRY}" + DOCKER_USERNAME="${DOCKER_REGISTRY}" +fi + docker build -t "${DOCKER_USERNAME}/doccano:latest" . docker build -t "${DOCKER_USERNAME}/doccano:$1" . -echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin - docker push "${DOCKER_USERNAME}/doccano:latest" docker push "${DOCKER_USERNAME}/doccano:$1"