From 9869e648205483b94f8fc1939ca7fd09ec56eadd Mon Sep 17 00:00:00 2001 From: Danny Coates Date: Wed, 3 Apr 2019 10:55:56 -0700 Subject: [PATCH] fix(ci): updated circleci deploy script for new env vars --- .circleci/deploy.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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