2017-11-27 13:56:51 +00:00
|
|
|
version: 2
|
|
|
|
|
|
|
|
jobs:
|
2017-11-27 20:13:59 +00:00
|
|
|
build_and_test:
|
|
|
|
docker:
|
2017-12-27 20:59:45 +00:00
|
|
|
- image: circleci/php:7.1
|
2017-11-27 20:13:59 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
2017-12-27 20:59:45 +00:00
|
|
|
- restore_cache:
|
|
|
|
keys:
|
|
|
|
- v1-dependencies-{{ checksum "composer.json" }}
|
|
|
|
- v1-dependencies-
|
|
|
|
- run: composer install -n --prefer-dist
|
|
|
|
- save_cache:
|
|
|
|
paths:
|
|
|
|
- ./vendor
|
|
|
|
key: v1-dependencies-{{ checksum "composer.json" }}
|
2017-12-27 21:03:50 +00:00
|
|
|
- run: ./vendor/bin/phpunit --log-junit ~/phpunit/junit.xml
|
|
|
|
- store_test_results:
|
|
|
|
path: ~/phpunit
|
|
|
|
- store_artifacts:
|
|
|
|
path: ~/phpunit
|
2017-11-27 14:11:50 +00:00
|
|
|
|
2018-01-03 19:40:28 +00:00
|
|
|
deploy:
|
|
|
|
docker:
|
|
|
|
- image: ansible/ansible:ubuntu1604
|
2018-01-03 20:38:52 +00:00
|
|
|
environment:
|
|
|
|
ANSIBLE_HOST_KEY_CHECKING: no
|
2018-01-03 19:40:28 +00:00
|
|
|
steps:
|
|
|
|
- run:
|
|
|
|
name: Install system packages.
|
|
|
|
command: pip install --upgrade pip && pip install ansible
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
2018-01-03 20:18:44 +00:00
|
|
|
key: v1-{{ .Branch }}-{{ checksum "./ansible/requirements.yml" }}
|
2018-01-03 20:26:30 +00:00
|
|
|
- run: ansible-galaxy install -r ansible/requirements.yml
|
2018-01-03 19:40:28 +00:00
|
|
|
- save_cache:
|
2018-01-03 20:18:44 +00:00
|
|
|
key: v1-{{ .Branch }}-{{ checksum "./ansible/requirements.yml" }}
|
2018-01-03 19:40:28 +00:00
|
|
|
paths:
|
|
|
|
- '/root/.ansible/roles'
|
2018-01-03 23:00:54 +00:00
|
|
|
- run: ansible-playbook ansible/deploy.yml -i ansible/hosts -e 'git_branch=master' -u opdavies --become
|
2018-01-03 19:40:28 +00:00
|
|
|
|
2017-11-27 14:11:50 +00:00
|
|
|
workflows:
|
2017-11-27 20:13:59 +00:00
|
|
|
version: 2
|
|
|
|
build_test_and_deploy:
|
|
|
|
jobs:
|
|
|
|
- build_and_test
|
2018-01-03 20:21:10 +00:00
|
|
|
- deploy:
|
|
|
|
requires:
|
|
|
|
- build_and_test
|
2017-11-29 08:50:24 +00:00
|
|
|
nightly:
|
|
|
|
jobs:
|
2018-01-05 01:53:10 +00:00
|
|
|
- build_test_and_deploy
|
2017-11-29 08:50:24 +00:00
|
|
|
triggers:
|
|
|
|
- schedule:
|
2017-12-21 19:04:17 +00:00
|
|
|
cron: "0 4 * * *"
|
2017-11-29 08:50:24 +00:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only: master
|