-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
64 lines (48 loc) · 1.94 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
language: php
# This can be set to whatever you want since Lando is taking care of your deps
php:
- 7.1
services:
- docker
before_install:
# Install Lando
- 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
# Sanity check to make sure we are rolling
- lando version
script:
# Start the site
- lando start -- -v
# 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
# Unit tests
# cd web
# lando phpunit -c core --testsuite unit --exclude-group Composer
# cd ..
# Do platform stuff
# Verify we are logged in
- lando platform auth:info
# Generate and post an ssh key and then wait because Platform seems to
# refresh keys every 90 seconds
# NOTE: If you are getting consistent DB pull failures then you might want to increase the sleep
- lando platform ssh-key:add -y
- sleep 200
# Dump and import the database
- lando platform db:dump --gzip --file=dump.sql.gz --project=$PLATFORMSH_PROJECT_ID --environment=master --identity-file=/var/www/.ssh/id_rsa
- lando db-import dump.sql.gz
- rm -f dump.sql.gz
# This could be potentially problematic if someone adds their own ssh key after we generate one above
# and before we run the below
- lando ssh -c "/var/www/.platformsh/bin/platform ssh-key:delete \$(/var/www/.platformsh/bin/platform ssh-keys --format=csv | tail -1 | cut -d ',' -f 1)"
# Check to see if we succeeded
- cd web
- lando drush status && lando drush cr
- cd ..
# Run db required tests eg behat
- lando behat --config=/app/tests/behat-lando.yml