From 109b89542b0155fdd72a85396a8a48be957474b0 Mon Sep 17 00:00:00 2001 From: Devon Blandin Date: Tue, 22 Mar 2016 16:59:57 -0400 Subject: [PATCH 1/2] Update CircleCI config with patrick and GCR json key --- circle.yml | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/circle.yml b/circle.yml index 58981a7e..11259a50 100644 --- a/circle.yml +++ b/circle.yml @@ -1,29 +1,34 @@ machine: services: - docker - environment: - CLOUDSDK_CORE_DISABLE_PROMPTS: 1 - PRIVATE_REGISTRY: us.gcr.io/code_climate dependencies: override: - - docker info - - docker build -t=$PRIVATE_REGISTRY/$CIRCLE_PROJECT_REPONAME:b$CIRCLE_BUILD_NUM . + - > + 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: - - docker run $PRIVATE_REGISTRY/$CIRCLE_PROJECT_REPONAME:b$CIRCLE_BUILD_NUM bundle exec rake + - make test deployment: registry: branch: master - owner: codeclimate commands: - - echo $GCLOUD_JSON_KEY_BASE64 | sed 's/ //g' | base64 -d > /tmp/gcloud_key.json - - curl https://sdk.cloud.google.com | bash - - gcloud auth activate-service-account --key-file /tmp/gcloud_key.json - - gcloud docker -a - - docker push $PRIVATE_REGISTRY/$CIRCLE_PROJECT_REPONAME:b$CIRCLE_BUILD_NUM + - > + 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 notify: webhooks: From 00b20a00f82f62c5bb402e1c13c6e3ebdfd9ec17 Mon Sep 17 00:00:00 2001 From: Devon Blandin Date: Tue, 22 Mar 2016 17:13:27 -0400 Subject: [PATCH 2/2] Split make test and citest targets --- Makefile | 5 ++++- circle.yml | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 60c2fdcc..2708ab5e 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: image test +.PHONY: image test citest IMAGE_NAME ?= codeclimate/codeclimate-duplication @@ -6,4 +6,7 @@ image: docker build --rm -t $(IMAGE_NAME) . test: image + docker run --tty --interactive --rm $(IMAGE_NAME) bundle exec rake + +citest: docker run --rm $(IMAGE_NAME) bundle exec rake diff --git a/circle.yml b/circle.yml index 11259a50..e76e457c 100644 --- a/circle.yml +++ b/circle.yml @@ -16,7 +16,7 @@ dependencies: test: override: - - make test + - make citest deployment: registry: