From 4a154cbf7bb41e707c5950828ca1b2658d436609 Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Fri, 17 Aug 2018 12:51:58 -0400 Subject: change how builds work slightly --- .circleci/config.yml | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to '.circleci') diff --git a/.circleci/config.yml b/.circleci/config.yml index d8c30f717..fe1263ee9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -149,22 +149,26 @@ jobs: - *store_log - deploy: command: | - TAG="$(cat /app/build_info/tag.txt)" - [[ "$CIRCLE_BRANCH" == "master" ]] || exit 0 [[ -n "$DOCKERHUB_REPO" && -n "$DOCKER_USER" && -n "$DOCKER_PASS" ]] || exit 0 - [[ -n "$GITHUB_PERSONAL_TOKEN" ]] || exit 0 docker login -u "$DOCKER_USER" -p "$DOCKER_PASS" - if [[ -n "$TAG" && -f build_info/publish.txt ]]; then - git config credential.helper "cache --timeout 120" - git config user.email "$GITHUB_EMAIL" - git config user.name "$GITHUB_NAME" - git tag $TAG - git push https://${GITHUB_PERSONAL_TOKEN}:x-oauth-basic@github.com/$GITHUB_REPO.git $TAG - docker tag bmo "$DOCKERHUB_REPO:$TAG" - docker push "$DOCKERHUB_REPO:$TAG" + if [[ "$CIRCLE_BRANCH" == "master" ]]; then + TAG="$(cat /app/build_info/tag.txt)" + if [[ -n "$TAG" && -f build_info/publish.txt ]]; then + [[ -n "$GITHUB_PERSONAL_TOKEN" ]] || exit 0 + git config credential.helper "cache --timeout 120" + git config user.email "$GITHUB_EMAIL" + git config user.name "$GITHUB_NAME" + git tag $TAG + git push https://${GITHUB_PERSONAL_TOKEN}:x-oauth-basic@github.com/$GITHUB_REPO.git $TAG + docker tag bmo "$DOCKERHUB_REPO:$TAG" + docker push "$DOCKERHUB_REPO:$TAG" + fi + docker tag bmo "$DOCKERHUB_REPO:latest" + docker push "$DOCKERHUB_REPO:latest" + else + docker tag bmo "$DOCKERHUB_REPO:$CIRCLE_BRANCH" + docker push "$DOCKERHUB_REPO:$CIRCLE_BRANCH" fi - docker tag bmo "$DOCKERHUB_REPO:latest" - docker push "$DOCKERHUB_REPO:latest" test_sanity: parallelism: 1 -- cgit v1.2.3-24-g4f1b