File tree 5 files changed +1089
-310
lines changed
5 files changed +1089
-310
lines changed Original file line number Diff line number Diff line change
1
+ orbs :
2
+
3
+
1
4
version : 2
5
+
6
+ base : &base
7
+ machine :
8
+ docker_layer_caching : true
9
+ working_directory : ~/codeclimate/codeclimate-phpmd
10
+
11
+
12
+
2
13
jobs :
3
14
build :
4
- machine :
5
- enabled : true
6
- image : circleci/classic:201709-01
7
- environment :
8
- CLOUDSDK_CORE_DISABLE_PROMPTS : 1
9
- PRIVATE_REGISTRY : us.gcr.io/code_climate
10
- IMAGE_NAME : ${PRIVATE_REGISTRY}/${CIRCLE_PROJECT_REPONAME}:b${CIRCLE_BUILD_NUM}
15
+ << : *base
11
16
steps :
12
17
- checkout
18
+ - run : make image
19
+
20
+ test :
21
+ << : *base
22
+ steps :
23
+ - checkout
24
+ - run : make test
25
+
26
+ release :
27
+ << : *base
28
+ steps :
29
+ - checkout
30
+ - run : make image
31
+ - run : echo "$GCR_JSON_KEY" | docker login -u _json_key --password-stdin us.gcr.io
13
32
- run :
14
- name : Prebuild images
15
- command : make test-image
16
- - run :
17
- name : Tests
18
- command : make test
19
- - deploy :
20
- name : Deployment
33
+ name : Push image to GCR
21
34
command : |
22
- if [ "${CIRCLE_BRANCH}" == "master" ]; then
23
- echo ${GCLOUD_JSON_KEY_BASE64} | sed 's/ //g' | base64 -d > /tmp/gcloud_key.json
24
- curl https://sdk.cloud.google.com | bash
25
- gcloud auth activate-service-account ${gcloud_account_email} --key-file /tmp/gcloud_key.json
26
- gcloud docker -a
27
- docker push ${IMAGE_NAME}
28
- fi
35
+ docker tag $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME \
36
+ us.gcr.io/code-climate/codeclimate-phpmd:b$CIRCLE_BUILD_NUM
37
+ docker push us.gcr.io/code-climate/codeclimate-phpmd:b$CIRCLE_BUILD_NUM
38
+
39
+ workflows :
40
+ version : 2
41
+ build_release :
42
+ jobs :
43
+ - build
44
+ - test :
45
+ requires :
46
+ - build
47
+ - release :
48
+ requires :
49
+ - test
50
+
29
51
30
52
notify :
31
53
webhooks :
Original file line number Diff line number Diff line change @@ -23,12 +23,11 @@ RUN apk add --no-cache \
23
23
php7-tokenizer \
24
24
php7-xmlwriter \
25
25
php7-xml && \
26
- ln -sf /usr/bin/php7 /usr/bin/php && \
27
- apk add --no-cache curl && \
28
- curl -sS https://getcomposer.org/installer | php && \
29
- mv composer.phar /usr/local/bin/composer && \
30
- apk del --purge curl && \
31
- rm -r ~/.composer
26
+ ln -sf /usr/bin/php7 /usr/bin/php
27
+
28
+ # Bring composer
29
+ COPY --from=composer /usr/bin/composer /usr/local/bin/composer
30
+
32
31
33
32
# Install Dependencies
34
33
COPY composer.* ./
@@ -38,13 +37,13 @@ RUN composer install --no-dev && \
38
37
39
38
# Build Content
40
39
COPY bin/build-content ./bin/build-content
41
- RUN apk add --no-cache ruby ruby-json&& \
42
- gem install httparty --no-rdoc --no-ri && \
40
+ RUN apk add --no-cache ruby ruby-json ruby-bigdecimal && \
41
+ gem install rdoc httparty --no-document && \
43
42
./bin/build-content && \
44
43
chown -R app:app content && \
45
- gem uninstall httparty && \
44
+ gem uninstall rdoc httparty && \
46
45
rm -rf $( gem environment gemdir ) && \
47
- apk del --purge ruby ruby-json && \
46
+ apk del --purge ruby ruby-json ruby-bigdecimal && \
48
47
rm -r /var/cache/* ~/.gem
49
48
50
49
COPY . ./
Original file line number Diff line number Diff line change @@ -19,8 +19,6 @@ composer-update:
19
19
$(IMAGE_NAME ) \
20
20
sh -c ' cd /usr/src/app && composer update'
21
21
22
- citest : test
23
-
24
22
test :
25
23
@$(MAKE ) test-image > /dev/null
26
24
docker run \
You can’t perform that action at this time.
0 commit comments