diff --git a/.circleci/config.yml b/.circleci/config.yml index cd5298225..1e68c8eaa 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -25,13 +25,12 @@ jobs: circleci step halt fi - run: make image - - run: echo "$GCR_JSON_KEY" | docker login -u _json_key --password-stdin us.gcr.io + - run: echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin - run: - name: Push image to GCR + name: Push image to Dockerhub 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 + make release RELEASE_TAG="b$CIRCLE_BUILD_NUM" + make release RELEASE_TAG="$(echo $CIRCLE_BRANCH | grep -oP 'channel/\K[\w\-]+')" workflows: version: 2 @@ -39,6 +38,7 @@ workflows: jobs: - test - release_images: + context: Quality requires: - test filters: @@ -47,4 +47,4 @@ workflows: notify: webhooks: - - url: https://cc-slack-proxy.herokuapp.com/circle \ No newline at end of file + - url: https://cc-slack-proxy.herokuapp.com/circle diff --git a/Makefile b/Makefile index 0f95da399..21aca4c31 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,11 @@ -.PHONY: image test test.unit test.integration test.system citest.base citest integration yarn.lock yarn.add +.PHONY: image test test.unit test.integration test.system citest.base citest integration yarn.lock yarn.add release IMAGE_NAME ?= codeclimate/codeclimate-eslint +RELEASE_REGISTRY ?= codeclimate + +ifndef RELEASE_TAG +override RELEASE_TAG = latest +endif NPM_TEST_TARGET ?= test NPM_INTEGRATION_TARGET ?= integration @@ -48,3 +53,7 @@ yarn.lock: package.json Dockerfile $(MAKE) image ./bin/yarn install touch yarn.lock + +release: + docker tag $(IMAGE_NAME) $(RELEASE_REGISTRY)/codeclimate-eslint:$(RELEASE_TAG) + docker push $(RELEASE_REGISTRY)/codeclimate-eslint:$(RELEASE_TAG)