Skip to content

Commit

Permalink
Merge pull request #98 from codeclimate/devon/pb-eslint-2-update-circ…
Browse files Browse the repository at this point in the history
…le-config

eslint-2: Update CircleCI config to use patrick
  • Loading branch information
dblandin committed Jun 2, 2016
2 parents 95911b8 + bfaa029 commit e2dcac7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 14 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ RUN apk --update add git jq && \
rm -rf eslint && \
apk del --purge git jq

RUN adduser -u 9000 -D app
COPY . /usr/src/app
RUN chown -R app:app /usr/src/app

RUN adduser -u 9000 -D app
USER app

VOLUME /code
WORKDIR /code

Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
.PHONY: image test
.PHONY: image test citest

IMAGE_NAME ?= codeclimate/codeclimate-eslint

image:
docker build --rm -t $(IMAGE_NAME) .

test: image
docker run --rm --workdir="/usr/src/app" $(IMAGE_NAME) npm run test
docker run --rm $(IMAGE_NAME) sh -c "cd /usr/src/app && npm run test"

citest:
docker run --rm $(IMAGE_NAME) sh -c "cd /usr/src/app && npm run test"
31 changes: 20 additions & 11 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,34 @@
machine:
services:
- docker
environment:
CLOUDSDK_CORE_DISABLE_PROMPTS: 1
PRIVATE_REGISTRY: us.gcr.io/code_climate
image_name: codeclimate-eslint

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:
- IMAGE_NAME="$PRIVATE_REGISTRY/$CIRCLE_PROJECT_REPONAME:b$CIRCLE_BUILD_NUM" make test
- make citest

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 $gcloud_account_email --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:
Expand Down

0 comments on commit e2dcac7

Please sign in to comment.