diff options
Diffstat (limited to '.circleci')
-rw-r--r-- | .circleci/config.yml | 30 |
1 files changed, 17 insertions, 13 deletions
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 |