Skip to content

Commit

Permalink
Moving to Circle 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
phansys committed Aug 22, 2018
1 parent 957940a commit ba23bca
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 42 deletions.
61 changes: 61 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
version: 2
jobs:
build:
# uncomment later
# docker_layer_caching: true
working_directory: ~/gush
docker:
- image: circleci/php:7.2-cli
steps:
- setup_remote_docker
- checkout
- run:
name: "Build Docker container"
command: |
docker build --rm=false -t gush .
- restore_cache:
keys:
- composer-v2.0.0-{{ checksum "composer.json" }}
- composer-v2.0.0-
- run:
name: "Install dependencies from Composer"
command: |
cd ~/gush
composer install --prefer-dist --optimize-autoloader --no-interaction
- save_cache:
key: composer-v2.0.0-{{ checksum "composer.json" }}
paths:
- /tmp/.composer/cache/files
- restore_cache:
key: phpunit-v2.0.0-{{ checksum "composer.json" }}
paths:
- /tmp/phpunit
- run:
name: "Running 'phpunit'"
command: |
cd ~/gush
mkdir -p ~/gush/var/circle-test-reports/phpunit
vendor/bin/phpunit --verbose --log-junit var/circle-test-reports/phpunit/junit.xml
- save_cache:
key: phpunit-v2.0.0-{{ checksum "composer.json" }}
paths:
- /tmp/phpunit
- store_test_results:
path: ~/gush/var/circle-test-reports
- store_artifacts:
path: ~/gush/var/circle-test-reports
- run:
name: "Running Docker container"
environment:
GUSH_CONFIG: /root/.gush
GUSH_LOCAL_CONFIG: /root/project
GUSH_USE_FS: true
command: docker run --tty gush -vvv --help
- deploy:
filters:
branches:
only: master
command: |
docker login -u coder20078 -p $DOCKER_HUB_PASSWORD -e coder20078@gmail.com
docker tag -f gush coder20078/gush
docker push coder20078/gush
7 changes: 2 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
FROM php:7.0.8-alpine
FROM php:7.2.8-cli-alpine

RUN set -xe \
&& apk add --no-cache \
git \
openssh-client

RUN curl -s https://getcomposer.org/installer | php \
&& chmod +x composer.phar \
&& mv composer.phar /usr/bin/composer

COPY --from=composer:1.6 /usr/bin/composer /usr/bin/composer
COPY ./src /usr/src/gush/src
COPY ./gush /usr/src/gush/gush
COPY ./composer.json /usr/src/gush/composer.json
Expand Down
37 changes: 0 additions & 37 deletions circle.yml

This file was deleted.

0 comments on commit ba23bca

Please sign in to comment.