-
Notifications
You must be signed in to change notification settings - Fork 40
/
.travis.template.yml
84 lines (81 loc) · 3.57 KB
/
.travis.template.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
version: "~> 1.0"
language: php
dist: jammy
php:
- 8.2
services:
- docker
stages:
- lint
- test
- deploy
env:
global:
- DDEV_NO_INSTRUMENTATION=true
- PANTHEON_GIT_URL="{{ PANTHEON_GIT_URL }}"
before_install:
- export PATH="$HOME/.config/composer/vendor/bin:$PATH"
- tmpdaemon=$(mktemp)
- sudo jq '."registry-mirrors" = ["DOCKER_MIRROR"]' /etc/docker/daemon.json > $tmpdaemon
- sudo mv $tmpdaemon /etc/docker/daemon.json
- sudo systemctl daemon-reload
- sudo systemctl restart docker
git:
depth: 500
jobs:
include:
- stage: Lint
name: PhpStan
script:
- "$TRAVIS_BUILD_DIR/ci-scripts/test_syntax.sh || travis_terminate 1;"
- composer install
- vendor/bin/phpstan analyse -c phpstan.neon
- stage: Lint
name: 'Drupal coding standard'
script:
- composer install || travis_terminate 1;
- vendor/bin/robo phpcs || travis_terminate 1;
- stage: Lint
name: 'Shell coding standard: shellcheck'
script:
- "$TRAVIS_BUILD_DIR/ci-scripts/install_shell.sh || travis_terminate 1;"
- "$TRAVIS_BUILD_DIR/ci-scripts/test_shell.sh || travis_terminate 1;"
- stage: Test
name: 'Backend tests: Functional tests'
if: (branch != "{{ GITHUB_DEPLOY_BRANCH }}" AND tag IS blank)
script:
- "(travis_retry $TRAVIS_BUILD_DIR/ci-scripts/install_ddev.sh) || travis_terminate 1;"
- "$TRAVIS_BUILD_DIR/ci-scripts/install_drupal.sh || travis_terminate 1;"
- "$TRAVIS_BUILD_DIR/ci-scripts/test_phpunit.sh || travis_terminate 1;"
- stage: Deploy
name: 'Backend tests: Functional tests and deploy to Pantheon QA'
if: branch = "{{ GITHUB_DEPLOY_BRANCH }}" AND type = push AND tag IS blank
script:
- "(travis_retry $TRAVIS_BUILD_DIR/ci-scripts/install_ddev.sh) || travis_terminate 1;"
- "$TRAVIS_BUILD_DIR/ci-scripts/install_drupal.sh || travis_terminate 1;"
- "$TRAVIS_BUILD_DIR/ci-scripts/test_phpunit.sh || travis_terminate 1;"
- "(travis_retry $TRAVIS_BUILD_DIR/ci-scripts/prepare_deploy.sh) || travis_terminate 1;"
- "(travis_retry ddev robo deploy:pantheon {{ PANTHEON_DEPLOY_BRANCH }} --no-interaction) || travis_terminate 1;"
- ddev composer install || travis_terminate 1;
- ddev robo deploy:notify || travis_terminate 1;
- stage: Deploy
name: 'Backend tests: Functional tests and deploy to Pantheon TEST'
if: tag IS present AND type = "push" AND tag !~ /live$/
script:
- "(travis_retry $TRAVIS_BUILD_DIR/ci-scripts/install_ddev.sh) || travis_terminate 1;"
- "$TRAVIS_BUILD_DIR/ci-scripts/install_drupal.sh || travis_terminate 1;"
- "$TRAVIS_BUILD_DIR/ci-scripts/test_phpunit.sh || travis_terminate 1;"
- "(travis_retry $TRAVIS_BUILD_DIR/ci-scripts/prepare_deploy.sh) || travis_terminate 1;"
- "(travis_retry ddev robo deploy:tag-pantheon --no-interaction $TRAVIS_TAG master) || travis_terminate 1;"
- "ddev composer install || travis_terminate 1;"
- "(travis_retry ddev robo deploy:pantheon-sync) || travis_terminate 1;"
- stage: Deploy
name: 'Backend tests: Functional tests and deploy to Pantheon LIVE'
if: tag IS present AND type = "push" AND tag =~ /live$/
script:
- "$TRAVIS_BUILD_DIR/ci-scripts/check_live_deploy.sh || travis_terminate 1;"
- "(travis_retry $TRAVIS_BUILD_DIR/ci-scripts/install_ddev.sh) || travis_terminate 1;"
- "$TRAVIS_BUILD_DIR/ci-scripts/install_drupal.sh || travis_terminate 1;"
- "$TRAVIS_BUILD_DIR/ci-scripts/test_phpunit.sh || travis_terminate 1;"
- "(travis_retry $TRAVIS_BUILD_DIR/ci-scripts/prepare_deploy.sh) || travis_terminate 1;"
- "(travis_retry ddev robo deploy:pantheon-sync live) || travis_terminate 1;"