diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..cd5298225 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,50 @@ +version: 2 + +jobs: + test: + machine: + docker_layer_caching: true + working_directory: ~/codeclimate/codeclimate-eslint + steps: + - checkout + - run: make image + - run: make citest + + release_images: + machine: + docker_layer_caching: true + working_directory: ~/codeclimate/codeclimate-eslint + steps: + - checkout + - run: + name: Validate owner + command: | + if [ "$CIRCLE_PROJECT_USERNAME" -ne "codeclimate" ] + then + echo "Skipping release for non-codeclimate branches" + circleci step halt + fi + - run: make image + - run: echo "$GCR_JSON_KEY" | docker login -u _json_key --password-stdin us.gcr.io + - run: + name: Push image to GCR + command: | + docker tag $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME \ + us.gcr.io/code-climate/codeclimate-eslint:b$CIRCLE_BUILD_NUM + docker push us.gcr.io/code-climate/codeclimate-eslint:b$CIRCLE_BUILD_NUM + +workflows: + version: 2 + build_deploy: + jobs: + - test + - release_images: + requires: + - test + filters: + branches: + only: /master|channel\/[\w-]+/ + +notify: + webhooks: + - url: https://cc-slack-proxy.herokuapp.com/circle \ No newline at end of file diff --git a/circle.yml b/circle.yml deleted file mode 100755 index 52dbcd220..000000000 --- a/circle.yml +++ /dev/null @@ -1,41 +0,0 @@ -machine: - node: - version: 6.1.0 - services: - - docker - -dependencies: - override: - - > - docker run - --env CIRCLE_BRANCH - --env CIRCLE_PROJECT_REPONAME - --env CIRCLE_TOKEN - --env GCR_JSON_KEY - --volume /var/run/docker.sock:/var/run/docker.sock - codeclimate/patrick pull || true - - make image - -test: - override: - - make citest - -deployment: - registry: - branch: /master|channel\/[\w-]+/ - commands: - - > - docker run - --env CIRCLE_BUILD_NUM - --env CIRCLE_PROJECT_REPONAME - --env GCR_JSON_KEY - --volume /var/run/docker.sock:/var/run/docker.sock - codeclimate/patrick push gcr - greenkeeper: - branch: /greenkeeper\/.*/ - commands: - - bin/circleci-update-yarn-lock - -notify: - webhooks: - - url: https://cc-slack-proxy.herokuapp.com/circle