diff --git a/.circleci/config.yml b/.circleci/config.yml index 36826ce303d8..62a65addab29 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -350,6 +350,9 @@ commands: make_release: description: "Builds and pushes a Docker image" parameters: + push: + type: boolean + default: false image_tag: type: string default: "latest" @@ -368,8 +371,16 @@ commands: docker version docker login -u "${DOCKERHUB_USER}" -p "${DOCKERHUB_PASS}" docker build -t app:build --label git.commit="$CIRCLE_SHA1" . - docker tag app:build "${DOCKERHUB_REPO}":<< parameters.image_tag >> - docker push "${DOCKERHUB_REPO}":<< parameters.image_tag >> + - when: + condition: << parameters.push >> + steps: + - run: + name: Wait for services to be ready + command: | + docker tag app:build "${DOCKERHUB_REPO}":<< parameters.image_tag >> + # Disable for now so we can test tagging on PR. + # docker push "${DOCKERHUB_REPO}":<< parameters.image_tag >> + better_checkout: description: circle ci checkout step on steroids @@ -610,12 +621,23 @@ jobs: - run: command: pytest -m "es_tests and not needs_locales_compilation and not static_assets" -v src/olympia/ + build-image: + <<: *defaults-release + steps: + - checkout + - make_release: + # use invalid tag + image_tag: test + # explicitly don't push + push: false + release-master: <<: *defaults-release steps: - checkout - make_release: image_tag: latest + push: true release-tag: <<: *defaults-release @@ -623,6 +645,7 @@ jobs: - checkout - make_release: image_tag: "${CIRCLE_TAG}" + push: true workflows: version: 2 @@ -635,6 +658,7 @@ workflows: - devhub - docs - main + - build-image - reviewers-and-zadmin - es-tests - localization