-
Notifications
You must be signed in to change notification settings - Fork 6
/
.travis.yml
37 lines (30 loc) · 1.38 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
language: python
dist: trusty
sudo: required
services:
- docker
python: 2.7
env:
DOCKER_COMPOSE_VERSION: 1.8.0
BUILD_CHECK_PHPCS: false
BUILD_CHECK_PHPUNIT: false
DEPLOY: false
before_install:
- cp .env.travis .env
- sudo apt-get update -qq
- sudo apt-get install ruby-dev
- pip install ansible
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
- gem install docker-sync
- sudo apt-get install sshpass
install:
- docker-sync start
- ansible-playbook ansible/drupal.travis.prod.yml --connection=local -i ansible/inventories/travis
script:
- if [ $BUILD_CHECK_PHPCS == true ]; then docker exec -it drupal vendor/bin/phpcbf --standard=Drupal -p ./web/themes/contrib ./web/modules/contrib; docker exec -it drupal vendor/bin/phpcs --standard=Drupal -p ./web/themes/contrib ./web/modules/contrib; fi;
- if [ $BUILD_CHECK_PHPUNIT == true ]; then docker exec -it drupal /bin/sh -c "cd web/core && ../../vendor/bin/phpunit --testsuite=unit"; fi;
after_success:
- if [ $TRAVIS_BRANCH == master ] && [ $TRAVIS_PULL_REQUEST == false ] && [ $DEPLOY == true ]; then ansible-playbook ansible/drupal.production.yml -i ansible/inventories/develop -e ansible_ssh_pass=${ssh_pass}; fi;