From 3ef33b34236a7341e668887e89ceb19ca8d16b4f Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Wed, 28 Mar 2018 13:36:27 -0400 Subject: no bug - always build latest tag --- .circleci/config.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e30304b63..1743d7451 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -141,18 +141,21 @@ jobs: - deploy: command: | TAG="$(cat /app/build_info/tag.txt)" - [[ "$CIRCLE_BRANCH" == "master" && -n "$TAG" ]] || exit 0 + [[ "$CIRCLE_BRANCH" == "master" ]] || exit 0 [[ -n "$DOCKERHUB_REPO" && -n "$DOCKER_USER" && -n "$DOCKER_PASS" ]] || exit 0 [[ -n "$GITHUB_PERSONAL_TOKEN" ]] || exit 0 - [[ -f build_info/publish.txt ]] || exit 0 - git config credential.helper cache - 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 login -u "$DOCKER_USER" -p "$DOCKER_PASS" - docker push "$DOCKERHUB_REPO:$TAG" + 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" + fi + docker tag bmo "$DOCKERHUB_REPO:latest" + docker push "$DOCKERHUB_REPO:latest" test_sanity: parallelism: 2 -- cgit v1.2.3-24-g4f1b