-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
57 lines (50 loc) · 1.96 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
sudo: required
addons:
artifacts:
# ...
paths:
- $(git ls-files -o | grep travis_artifacts | tr "\n" ":")
language: php
php:
- 7.2
env:
DOCKER_COMPOSE_VERSION: 1.24.1
COMPOSER_MEMORY_LIMIT: -1
services:
- docker
before_install:
- echo "memory_limit=2G" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
# Update docker engine for compose v2 support.
- sudo apt-get clean
- sudo apt-get update
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
- docker --version
# Disable xdebug.
- phpenv config-rm xdebug.ini
# Lets set-up our helper repository with all the docker config and use correct version in composer.json.
- git clone --branch 8.x https://github.com/StatCan/site-ccei.git
- cd site-ccei
# Install Drupal CCEI.
- export PR=https://api.github.com/repos/$TRAVIS_REPO_SLUG/pulls/$TRAVIS_PULL_REQUEST
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo `curl -s $PR | jq -r .head.ref`; fi)
- export COMPOSER_EXIT_ON_PATCH_FAILURE=1
- echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, PR=$PR, BRANCH=$BRANCH"
# Remove the composer lock file
- rm composer.lock
- composer global require "hirak/prestissimo:^0.3"
- composer global require "zaporylie/composer-drupal-optimizations:^1.0"
- if [ -n "$TRAVIS_TAG" ]; then composer require wcms/ccei:${TRAVIS_TAG}; else composer require wcms/ccei:dev-${BRANCH}#${TRAVIS_COMMIT}; fi
# Update the docker-compose binary for compose v2 support.
- sudo rm /usr/local/bin/docker-compose || true
- 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
- docker-compose --version
# Build out the Drupal infrastructure.
- make build
- docker-compose -f docker-compose-ci.yml up -d
- docker ps -a
- sleep 10
script:
- make drupal_install
- sudo make test