Skip to content

Commit 6ff08da

Browse files
committed
Moving to Circle 2.0
1 parent 957940a commit 6ff08da

File tree

3 files changed

+61
-42
lines changed

3 files changed

+61
-42
lines changed

.circleci/config.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
version: 2
2+
jobs:
3+
build:
4+
# uncomment later
5+
# docker_layer_caching: true
6+
working_directory: ~/gush
7+
docker:
8+
- image: circleci/php:7.2-cli
9+
steps:
10+
- setup_remote_docker
11+
- checkout
12+
- run:
13+
name: "Build Docker container"
14+
command: |
15+
docker build --rm=false -t gush .
16+
- restore_cache:
17+
keys:
18+
- composer-v2.0.0-{{ checksum "composer.json" }}
19+
- composer-v2.0.0-
20+
- run:
21+
name: "Install dependencies from Composer"
22+
command: |
23+
cd ~/gush
24+
composer install --prefer-dist --optimize-autoloader --no-interaction
25+
- save_cache:
26+
key: composer-v2.0.0-{{ checksum "composer.json" }}
27+
paths:
28+
- /tmp/.composer/cache/files
29+
- restore_cache:
30+
key: phpunit-v2.0.0-{{ checksum "composer.json" }}
31+
paths:
32+
- /tmp/phpunit
33+
- run:
34+
name: "Running 'phpunit'"
35+
command: |
36+
cd ~/gush
37+
mkdir -p ~/gush/var/circle-test-reports/phpunit
38+
vendor/bin/phpunit --verbose --log-junit var/circle-test-reports/phpunit/junit.xml
39+
- save_cache:
40+
key: phpunit-v2.0.0-{{ checksum "composer.json" }}
41+
paths:
42+
- /tmp/phpunit
43+
- store_test_results:
44+
path: ~/gush/var/circle-test-reports
45+
- store_artifacts:
46+
path: ~/gush/var/circle-test-reports
47+
- run:
48+
name: "Running Docker container"
49+
environment:
50+
GUSH_USE_FS: true
51+
command: docker run --tty -e GUSH_CONFIG=/root/.gush -e GUSH_LOCAL_CONFIG=/root/project gush -vvvv --help
52+
- deploy:
53+
filters:
54+
branches:
55+
only: master
56+
command: |
57+
docker login -u coder20078 -p $DOCKER_HUB_PASSWORD -e coder20078@gmail.com
58+
docker tag -f gush coder20078/gush
59+
docker push coder20078/gush

Dockerfile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
FROM php:7.0.8-alpine
1+
FROM php:7.2.8-cli-alpine
22

33
RUN set -xe \
44
&& apk add --no-cache \
55
git \
66
openssh-client
77

8-
RUN curl -s https://getcomposer.org/installer | php \
9-
&& chmod +x composer.phar \
10-
&& mv composer.phar /usr/bin/composer
11-
8+
COPY --from=composer:1.6 /usr/bin/composer /usr/bin/composer
129
COPY ./src /usr/src/gush/src
1310
COPY ./gush /usr/src/gush/gush
1411
COPY ./composer.json /usr/src/gush/composer.json

circle.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)