Skip to content

Commit 09a199a

Browse files
committed
Merge pull request #97 from codeclimate/devon/update-circle-config
Update CircleCI config to use patrick
2 parents e68858b + ac711a7 commit 09a199a

File tree

3 files changed

+28
-14
lines changed

3 files changed

+28
-14
lines changed

Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ RUN apk --update add git && \
99
npm install && \
1010
apk del --purge git
1111

12+
RUN adduser -u 9000 -D app
1213
COPY . /usr/src/app
14+
RUN chown -R app:app /usr/src/app
1315

14-
RUN adduser -u 9000 -D app
1516
USER app
17+
1618
VOLUME /code
1719
WORKDIR /code
1820

Makefile

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
.PHONY: image test
1+
.PHONY: image test citest
22

33
IMAGE_NAME ?= codeclimate/codeclimate-eslint
44

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

88
test: image
9-
docker run --rm --workdir="/usr/src/app" $(IMAGE_NAME) npm run test
9+
docker run --rm $(IMAGE_NAME) sh -c "cd /usr/src/app && npm run test"
10+
11+
citest:
12+
docker run --rm $(IMAGE_NAME) sh -c "cd /usr/src/app && npm run test"

circle.yml

+20-11
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,34 @@
11
machine:
22
services:
33
- docker
4-
environment:
5-
CLOUDSDK_CORE_DISABLE_PROMPTS: 1
6-
PRIVATE_REGISTRY: us.gcr.io/code_climate
7-
image_name: codeclimate-eslint
4+
5+
dependencies:
6+
override:
7+
- >
8+
docker run
9+
--env CIRCLE_BRANCH
10+
--env CIRCLE_PROJECT_REPONAME
11+
--env CIRCLE_TOKEN
12+
--env GCR_JSON_KEY
13+
--volume /var/run/docker.sock:/var/run/docker.sock
14+
codeclimate/patrick pull || true
15+
- make image
816

917
test:
1018
override:
11-
- IMAGE_NAME="$PRIVATE_REGISTRY/$CIRCLE_PROJECT_REPONAME:b$CIRCLE_BUILD_NUM" make test
19+
- make citest
1220

1321
deployment:
1422
registry:
1523
branch: master
16-
owner: codeclimate
1724
commands:
18-
- echo $gcloud_json_key_base64 | sed 's/ //g' | base64 -d > /tmp/gcloud_key.json
19-
- curl https://sdk.cloud.google.com | bash
20-
- gcloud auth activate-service-account $gcloud_account_email --key-file /tmp/gcloud_key.json
21-
- gcloud docker -a
22-
- docker push $PRIVATE_REGISTRY/$CIRCLE_PROJECT_REPONAME:b$CIRCLE_BUILD_NUM
25+
- >
26+
docker run
27+
--env CIRCLE_BUILD_NUM
28+
--env CIRCLE_PROJECT_REPONAME
29+
--env GCR_JSON_KEY
30+
--volume /var/run/docker.sock:/var/run/docker.sock
31+
codeclimate/patrick push gcr
2332
2433
notify:
2534
webhooks:

0 commit comments

Comments
 (0)