diff --git a/.circleci/deploy.sh b/.circleci/deploy.sh index b5937d94b4..00de5281b7 100755 --- a/.circleci/deploy.sh +++ b/.circleci/deploy.sh @@ -1,4 +1,4 @@ -#!/bin/bash -ex +#!/bin/bash -e MODULE=$1 DIR=$(dirname "$0") @@ -16,8 +16,13 @@ if grep -e "$MODULE" -e 'all' $DIR/../packages/test.list; then DOCKER_TAG="$CIRCLE_TAG" fi - if [ -n "${DOCKER_TAG}" ] && [ -n "${DOCKER_PASS}" ] && [ -n "${DOCKER_USER}"] && [ -n "${DOCKERHUB_REPO}"]; then - echo "$DOCKER_PASS" | docker login -u "$DOCKER_USER" --password-stdin + REPO=$(echo ${MODULE} | sed 's/-/_/g') + DOCKER_USER=DOCKER_USER_${REPO} + DOCKER_PASS=DOCKER_PASS_${REPO} + DOCKERHUB_REPO=mozilla/${MODULE} + + if [ -n "${DOCKER_TAG}" ] && [ -n "${!DOCKER_PASS}" ] && [ -n "${!DOCKER_USER}" ]; then + echo "${!DOCKER_PASS}" | docker login -u "${!DOCKER_USER}" --password-stdin echo ${DOCKERHUB_REPO}:${DOCKER_TAG} docker tag ${MODULE}:build ${DOCKERHUB_REPO}:${DOCKER_TAG} docker images