-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
85 lines (71 loc) · 2.59 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
language: php
php:
- '7.0'
services:
- docker
# Install lando
before_install:
- sudo apt-get -y update
- sudo apt-get -y install cgroup-bin curl
- curl -fsSL -o /tmp/lando-latest.deb http://installer.kalabox.io/lando-latest-dev.deb
- sudo dpkg -i /tmp/lando-latest.deb
- lando version
# Do the lando magic
script:
# Get our built out lando site running on travis
- lando start -- -v
- lando composer install
# Run non-db required tests eg linting/code standards/unit tests
# Lint the codez
- lando phplint
# Check code standards
# lando phpcs --config-set installed_paths /app/vendor/drupal/coder/coder_sniffer
# lando phpcs -n --report=full --standard=Drupal --ignore=*.tpl.php --extensions=install,module,php,inc web/modules web/themes web/profiles
# Run unit tests.
# - lando composer drupal-unit-tests
# Get the DB for more advanced things
- lando terminus auth:login --machine-token=$PANTHEON_MACHINE_TOKEN
- lando pull --code=none --database=dev --files=dev --rsync
# Check if we can bootstrap the site.
- cd web
- lando drush cr | grep "rebuild complete."
- cd ..
# Run Behat tests.
- lando behat --config=/app/tests/behat-pantheon.yml
# Spin up multidev branch
# 1. Check to see if this is a pull request build. there is a travis_pr envvar to check
# 2. if true:
# need to check if multidev already exists? maybe its fine to try to create again and fail
# If we need to create multidev
# - create a multidev environment based on the TRAVIS_BRANCH envvar
# - Make sure we are obeying the 11 char rule
# pull pantheon git repo into a separate directory
# - cd /tmp
# - git clone pantheonrep pantheon-build
# cd pantheon-build
# rm -rf /tmp/pantheon-build/*
# cp -rf $TRAVIS_REPO_ROOT/ /tmp/pantheon-build/
# git config setup
#- git config --global user.email "$GIT_EMAIL"
#- git config --global user.name "Circle CI"
#- git config --global core.fileMode false
# git add -A
# git commit -m "travis build whatever"
# git push origin multidevbranch
# run drush cim
# run drush dbupdate
# run drush cr
# Clean up posted SSH key
- lando terminus ssh-key:remove $(ssh-keygen -l -f ~/.lando/keys/pantheon.lando.id_rsa.pub | awk -F' ' '{print $2}' | sed 's/://g')
# merge into master via depoy script
#deploy:
# provider: script
# script: scripts/deploy.sh $MULTIDEV_BRANCH
# on:
# branch: master
# the script does:
# - terminus multidev:merge-to-dev $MULTIDEV_BRANCH
# - termius mulitdev:delete $MULTIDEV_BRANCH
# - terminus drush cim
# - terminus drush updatedb
# - terminus drush cr