forked from acquia/blt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
97 lines (87 loc) · 3.44 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Note that the example .travis.yml file for child projects lives in /install.
sudo: false
language: php
php:
- 5.6
- 7
matrix:
fast_finish: true
cache:
bundler: true
apt: true
directories:
- "$HOME/.composer/cache"
- "$HOME/.console"
- "$HOME/.drush/cache"
- "$HOME/.nvm"
- "vendor"
notifications:
# slack: acquia:KKfgpOkDhcO26Erv5uoZMfdP
addons:
ssh_known_hosts:
- svn-5223.devcloud.hosting.acquia.com
before_install:
# Decrypt private SSH key id_rsa_blt.enc, save as ~/.ssh/id_rsa_blt.
- if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then openssl aes-256-cbc -K $encrypted_c0b166e924da_key -iv $encrypted_c0b166e924da_iv -in id_rsa_blt.enc -out ~/.ssh/id_rsa -d; chmod 600 ~/.ssh/id_rsa; ls -lash ~/.ssh; eval "$(ssh-agent -s)"; ssh-add ~/.ssh/id_rsa; fi
- composer selfupdate
# Disable xdebug.
- phpenv config-rm xdebug.ini
# Enable $_ENV variables in PHP.
- echo 'variables_order = "EGPCS"' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
# Ensure that always_populate_raw_post_data PHP setting: Not set to -1 does not happen.
- echo "always_populate_raw_post_data = -1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- git config --global user.name "Travis-CI"
- git config --global user.email "[email protected]"
- mysql -e 'CREATE DATABASE drupal;'
install:
# Load composer dependencies.
- composer validate --no-check-all --ansi
# Remove acquia packages from cache before running `composer install`.
- rm -rf vendor/acquia
- composer install
- export PATH=$TRAVIS_BUILD_DIR/vendor/bin:$PATH
# Install proper version of node for front end tasks.
- nvm install 4.4.1
- nvm use 4.4.1
# Initialize drupal console default configuration.
- drupal init
before_script:
# Clear drush release history cache, to pick up new releases.
- rm -f ~/.drush/cache/download/*---updates.drupal.org-release-history-*
# Verify that no git diffs (caused by line ending variation) exist.
- git diff --exit-code
script:
# Ensure code quality of 'blt' itself.
- phpcs --standard=./vendor/drupal/coder/coder_sniffer/Drupal/ruleset.xml tests
# Generate a new 'blt-project' project.
- cp -R blt-project ../
- cd ../blt-project
- git init
- git add -A
# Commit so that susbsequent git commit tests have something to ammend.
- git commit -m 'Initial commit.'
# BLT is the only dependency at this point. Install it.
- composer install
- export PATH=$TRAVIS_BUILD_DIR/../blt-project/vendor/bin:$PATH
- yes | blt init
# The local.hostname must be set to 127.0.0.1:8888 because we are using drush runserver to run the site on Travis CI.
- drupal yaml:update:value project.yml project.local.hostname '127.0.0.1:8888'
- blt configure
# Running `blt init` modified composer.json, so we must update.
- composer update
# Call targets in the new 'blt-project' project.
- blt ci:build:validate:test -Dcreate_alias=false -Dbehat.run-server=true -Dbehat.launch-phantom=true
# Deploy build artifact.
- blt deploy:build
# Add Drupal VM config to repo.
- blt vm:init
# Switch back to 'blt' directory.
- cd ../blt
# Run 'blt' phpunit tests, excluding deploy-push tests.
- phpunit tests/phpunit --exclude-group deploy-push
deploy:
provider: script
script: cd ../blt-project && blt deploy -Ddeploy.commitMsg="Automated commit by Travis CI for Build ${TRAVIS_BUILD_ID}" -Ddeploy.branch="8.x-build" && phpunit tests/phpunit --group=deploy
skip_cleanup: true
on:
branch: 8.x