-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.gitlab-ci.yml
125 lines (115 loc) · 2.8 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
stages:
- test
- deploy
- release
- merge_request
.git_flow: &GIT_FLOW
stage: release
only:
- develop
when: manual
.import_git: &IMPORT_GIT
before_script:
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- git remote set-url --push origin $(perl -pe 's#.*@(.+?(\:\d+)?)/#git@\1:#' <<< $CI_REPOSITORY_URL)
- bash private/scripts/import_git_remote.sh
.branch_prefixes: &BRANCH_PREFIXES
only:
- /(feature|bugfix|hotfix)\/?(.*)/
image: barrelny/multipurpose-ci:0.0.14
# cache:
# key: ${CI_COMMIT_REF_SLUG}
# paths:
# - wp-content/themes/$THEME_NAME/node_modules/
test_grammars:
<<: *BRANCH_PREFIXES
stage: test
script:
- bash private/scripts/test_grammars.sh
test_modules:
<<: *BRANCH_PREFIXES
stage: test
script:
- bash private/scripts/test_modules.sh
test_visual_regression:
<<: *BRANCH_PREFIXES
stage: test
script:
- bash private/scripts/test_visual_regression.sh
artifacts:
when: always
paths:
- private/scripts/backstopjs/backstop_data
expire_in: 1 week
allow_failure: true
live_deploy:
stage: deploy
only:
- master
when: manual
<<: *IMPORT_GIT
script:
- bash private/scripts/live_deploy.sh
environment:
name: live
url: https://$CI_ENVIRONMENT_SLUG-$PANTHEON_SITE_ID.pantheonsite.io
dev_test_deploy:
stage: deploy
only:
- master
<<: *IMPORT_GIT
script:
- bash private/scripts/dev_test_deploy.sh
environment:
name: test
url: https://$CI_ENVIRONMENT_SLUG-$PANTHEON_SITE_ID.pantheonsite.io
# multidev
multidev_deploy:
stage: deploy
only:
- /(develop|feature|bugfix|hotfix)\/?(.*)/
<<: *IMPORT_GIT
script:
- bash private/scripts/multidev_deploy.sh
- bash private/scripts/gitlab/environment_url.sh
artifacts:
reports:
dotenv: deploy.env
environment:
name: multidev/${CI_BUILD_REF_SLUG}
url: $ENV_URL
on_stop: multidev_remove
multidev_remove:
stage: deploy
only:
- /^(feature|bugfix|hotfix)\/.*/
when: manual
<<: *IMPORT_GIT
script:
- bash private/scripts/multidev_remove.sh
environment:
name: multidev/${CI_BUILD_REF_SLUG}
action: stop
create_merge_request:
stage: merge_request
only:
- /^(feature|bugfix|support)\/.*/
when: manual
script:
- ./private/scripts/merge_request.sh
prepare_patch_release:
<<: *GIT_FLOW
<<: *IMPORT_GIT
script:
- ./private/scripts/prepare.sh -v=patch -f=release -s -y -t=$THEME_NAME
prepare_minor_release:
<<: *GIT_FLOW
<<: *IMPORT_GIT
script:
- ./private/scripts/prepare.sh -v=minor -f=release -s -y -t=$THEME_NAME
prepare_major_release:
<<: *GIT_FLOW
<<: *IMPORT_GIT
script:
- ./private/scripts/prepare.sh -v=major -f=release -s -y -t=$THEME_NAME