-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
80 lines (72 loc) · 1.69 KB
/
.gitlab-ci.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
# Build tools Dockerfile
image: quay.io/pantheon-public/build-tools-ci:5.x
# Default Variables
variables:
CI_BUILD_NUMBER: $CI_PIPELINE_IID
DEFAULT_SITE: $CI_PROJECT_NAME
PR_NUMBER: $CI_MERGE_REQUEST_IID
CI_BRANCH: $CI_COMMIT_REF_NAME
# Cache libraries in between jobs
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- vendor/
- /composer/cache
- $HOME/.composer/cache
stages:
- build
- test
- cleanup
before_script:
- export PATH="$PATH:$CI_PROJECT_DIR/.ci/scripts"
- export BASH_ENV="$HOME/.envvarsrc"
- /build-tools-ci/scripts/set-environment
- source $BASH_ENV
# See https://docs.gitlab.com/ee/ci/ssh_keys/README.html
- eval $(ssh-agent -s) && ssh-add <(echo "$SSH_PRIVATE_KEY")
- terminus -n auth:login --machine-token="$TERMINUS_TOKEN"
deploy:
stage: build
environment:
name: deploy/$TERMINUS_ENV
url: https://$TERMINUS_ENV-$TERMINUS_SITE.pantheonsite.io/
script:
- echo "Target site.env is $TERMINUS_SITE.$TERMINUS_ENV"
- 01-prepare
- composer -n build-assets
- 02-init-site-under-test-clone-existing
only:
- merge_requests
- master
test:code_sniff_unit_test:
stage: test
script:
- composer install --no-ansi --no-interaction --optimize-autoloader --no-progress
- rm -rf web
- git checkout -- web
- composer -n lint
- composer -n code-sniff
- composer -n unit-test
only:
- merge_requests
- master
test:behat:
stage: test
script:
- composer install --no-ansi --no-interaction --optimize-autoloader --no-progress
- 03-test
- 04-post-test
only:
- merge_requests
- master
test:behat:cleanup:
stage: cleanup
when: always
script:
- 05-merge-master
- 09-cleanup-fixtures
only:
- merge_requests
- master
dependencies:
- test:behat