diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 39ced5d4..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,186 +0,0 @@ ---- -# We will use circleci mozilla-services context: eliot-circleci-image-push -# -version: 2.1 -orbs: - docker: circleci/docker@2.2.0 - -jobs: - build-and-test: - docker: - - image: cimg/python:3.11.1 - - steps: - - checkout - - - setup_remote_docker: - docker_layer_caching: true - version: 20.10.18 - - - run: - name: Get info - command: | - uname -v - docker info - - - run: - name: Create version.json - # yamllint disable rule:line-length - command: | - # create a version.json per - # https://github.com/mozilla-services/Dockerflow/blob/master/docs/version_object.md - printf '{"commit":"%s","version":"%s","source":"https://github.com/%s/%s","build":"%s"}\n' \ - "$CIRCLE_SHA1" \ - "$CIRCLE_TAG" \ - "$CIRCLE_PROJECT_USERNAME" \ - "$CIRCLE_PROJECT_REPONAME" \ - "$CIRCLE_BUILD_URL" > version.json - # yamllint enable rule:line-length - - - run: - name: Output version.json - command: cat version.json - - - run: - name: Build Docker images - command: | - # build eliot container - make build - - - run: - name: Verify requirements.txt contains correct dependencies - # yamllint disable rule:line-length - command: | - docker compose run --rm --no-deps test-ci bash ./bin/run_verify_reqs.sh - # yamllint enable rule:line-length - - - run: - name: Run lint check - command: | - make .env - docker compose run --rm --no-deps test-ci bash ./bin/run_lint.sh - - - run: - name: Run Eliot tests - command: | - make .env - docker compose up -d fakesentry statsd - docker compose run --rm test-ci bash ./bin/run_test.sh eliot - - - run: - name: Build docs - command: | - make .env - docker compose run --rm --no-deps test-ci bash make -C docs/ html - - - run: - name: Tag Image - command: | - docker tag eliot:build $CIRCLE_PROJECT_REPONAME:${CIRCLE_SHA1:0:9} - - - run: - name: Persist image - command: | - mkdir -p artifacts - docker save -o artifacts/eliot.tar $CIRCLE_PROJECT_REPONAME:${CIRCLE_SHA1:0:9} - - - persist_to_workspace: - root: artifacts - paths: - - eliot.tar - - publish-registry: - executor: docker/machine - parameters: - image_tag: - type: string - registry: - type: string - registry_authentication: - default: [] - description: Steps required to authenticate on targeted registry - type: steps - steps: - - checkout - - when: - condition: <> - steps: <> - - attach_workspace: - at: artifacts - - run: - name: Load Docker image artifact from previous job - command: docker load -i artifacts/eliot.tar - - run: - name: Generate image name - command: | - echo 'export PARAM_REGISTRY="<< parameters.registry >>"' >> "$BASH_ENV" - echo 'export PARAM_IMAGE_TAG="<< parameters.image_tag >>"' >> "$BASH_ENV" - echo 'export IMAGE_NAME="$CIRCLE_PROJECT_REPONAME"' >> "$BASH_ENV" - - run: - name: Re-tag artifact - command: docker tag $CIRCLE_PROJECT_REPONAME:${CIRCLE_SHA1:0:9} $PARAM_REGISTRY/$IMAGE_NAME:$PARAM_IMAGE_TAG - - docker/push: - step-name: Push image to registry - image: $IMAGE_NAME - tag: $PARAM_IMAGE_TAG - registry: $PARAM_REGISTRY - - -workflows: - version: 2 - ci: - jobs: - - build-and-test: - filters: - tags: - ignore: /^v.*/ - branches: - ignore: main - - publish: - jobs: - - build-and-test: - name: build-and-test-tag - filters: - tags: - only: /^v.*/ - branches: - ignore: /.*/ - - - build-and-test: - name: build-and-test-main-commit - filters: - branches: - only: main - - - publish-registry: - name: Publish tag to GAR - context: eliot-circleci-image-push - registry: us-docker.pkg.dev/moz-fx-eliot-prod/eliot-prod - image_tag: $CIRCLE_TAG - registry_authentication: &gar-auth - - run: - name: Authenticate GAR - command: | - echo $GCLOUD_SERVICE_KEY_ENCODED | base64 -d > creds.json - gcloud auth activate-service-account --key-file creds.json - gcloud auth configure-docker us-docker.pkg.dev - requires: - - build-and-test-tag - filters: - tags: - only: /.*/ - branches: - ignore: /.*/ - - - publish-registry: - name: Publish latest to GAR - context: eliot-circleci-image-push - registry: us-docker.pkg.dev/moz-fx-eliot-prod/eliot-prod - image_tag: latest - registry_authentication: *gar-auth - requires: - - build-and-test-main-commit - filters: - branches: - only: main