forked from Alfresco/alfresco-ansible-deployment
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
294 lines (257 loc) · 7.83 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
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
---
import:
- source: Alfresco/alfresco-build-tools:[email protected]
os: linux
dist: xenial
language: python
python:
- "3.9.0"
services:
- docker
branches:
only:
- master
- contribs
- /feature.*/
- /fix.*/
- /(?i:OPSEXP)-.*/
- /^dependabot\/.*$/
env:
global:
- BRANCH_NAME="${TRAVIS_BRANCH}"
- BUILD_NUMBER="${TRAVIS_BUILD_NUMBER}"
- MOLECULE_NO_LOG=false
- AWS_REGION=eu-west-1
- MOLECULE_IT_AWS_VPC_SUBNET_ID=subnet-6bdd4223
- DTAS_VERSION=v1.1.1
before_script:
- |
if [ -n "$MOLECULE_ROLE_IMAGE" ] || [ -n "$MOLECULE_IT_SCENARIO" ]; then
travis_retry ansible-galaxy install -r requirements.yml
fi
script:
- ./tests/molecule_it/script.sh verify
after_script:
- ./tests/molecule_it/script.sh destroy
cache:
directories:
- $HOME/.ansible/collections
stages:
- name: lint
- name: Roles tests
- name: Integration tests
- name: Release Stage
if: branch = master AND commit_message =~ /\[release\]/
jobs:
include:
- stage: Roles tests
name: ActiveMQ tests on Centos 7
env:
- "MOLECULE_ROLE_IMAGE=centos:7"
script:
- cd roles/activemq/ && molecule test
- stage: Roles tests
name: ActiveMQ tests on Ubuntu 20.04
env:
- "MOLECULE_ROLE_IMAGE=ubuntu:20.04"
script:
- cd roles/activemq/ && molecule test
- stage: Roles tests
name: ADW tests on Centos 7
env:
- "MOLECULE_ROLE_IMAGE=centos:7"
script:
- cd roles/adw/ && molecule test
- stage: Roles tests
name: ADW tests on Ubuntu 20.04
env:
- "MOLECULE_ROLE_IMAGE=ubuntu:20.04"
script:
- cd roles/adw/ && molecule test
- stage: Roles tests
name: Common tests on Ubuntu 20.04
env:
- "MOLECULE_ROLE_IMAGE=ubuntu:20.04"
script:
- cd roles/common/ && molecule test
- stage: Roles tests
name: Java tests on Ubuntu 20.04
env:
- "MOLECULE_ROLE_IMAGE=ubuntu:20.04"
script:
- cd roles/java/ && molecule test
- stage: Roles tests
name: Nginx tests on Centos 7
env:
- "MOLECULE_ROLE_IMAGE=centos:7"
script:
- cd roles/nginx/ && molecule test
- stage: Roles tests
name: Nginx tests on Ubuntu 20.04
env:
- "MOLECULE_ROLE_IMAGE=ubuntu:20.04"
script:
- cd roles/nginx/ && molecule test
- stage: Roles tests
name: Repository tests on Centos 7
env:
- "MOLECULE_ROLE_IMAGE=centos:7"
script:
- cd roles/repository/
- molecule converge || return 1
- sleep 5m
- travis_wait 30 molecule verify
- molecule destroy
- stage: Roles tests
name: Repository tests on Ubuntu 20.04
env:
- "MOLECULE_ROLE_IMAGE=ubuntu:20.04"
script:
- cd roles/repository/
- molecule converge || return 1
- sleep 5m
- travis_wait 30 molecule verify
- molecule destroy
- stage: Roles tests
name: Search tests on Centos 7
env:
- "MOLECULE_ROLE_IMAGE=centos:7"
script:
- cd roles/search && molecule test
- stage: Roles tests
name: Search tests on Ubuntu 20.04
env:
- "MOLECULE_ROLE_IMAGE=ubuntu:20.04"
script:
- cd roles/search && molecule test
- stage: Roles tests
name: SFS tests on Centos 7
env:
- "MOLECULE_ROLE_IMAGE=centos:7"
script:
- cd roles/sfs/ && molecule test
- stage: Roles tests
name: SFS tests on Ubuntu 20.04
env:
- "MOLECULE_ROLE_IMAGE=ubuntu:20.04"
script:
- cd roles/sfs/ && molecule test
- stage: Roles tests
name: Sync tests on Centos 7
env:
- "MOLECULE_ROLE_IMAGE=centos:7"
script:
- cd roles/sync
- molecule converge || return 1
- sleep 1m
- molecule verify
- molecule destroy
- stage: Roles tests
name: Sync tests on Ubuntu 20.04
env:
- "MOLECULE_ROLE_IMAGE=ubuntu:20.04"
script:
- cd roles/sync
- molecule converge || return 1
- sleep 1m
- molecule verify
- molecule destroy
- stage: Roles tests
name: Tomcat tests on Ubuntu 20.04
env:
- "MOLECULE_ROLE_IMAGE=ubuntu:20.04"
script:
- cd roles/tomcat/ && molecule test
- stage: Roles tests
name: Transformers tests on Centos 7
env:
- "MOLECULE_ROLE_IMAGE=centos:7"
script:
- cd roles/transformers
- molecule converge || return 1
- sleep 1m
- molecule verify
- molecule destroy
- stage: Roles tests
name: Transformers tests on Ubuntu 20.04
env:
- "MOLECULE_ROLE_IMAGE=ubuntu:20.04"
script:
- cd roles/transformers
- molecule converge || return 1
- sleep 1m
- molecule verify
- molecule destroy
- stage: Roles tests
name: Trouter tests on Centos 7
env:
- "MOLECULE_ROLE_IMAGE=centos:7"
script:
- cd roles/trouter
- molecule converge || return 1
- sleep 1m
- molecule verify
- molecule destroy
- stage: Roles tests
name: Trouter tests on Ubuntu 20.04
env:
- "MOLECULE_ROLE_IMAGE=ubuntu:20.04"
script:
- cd roles/trouter
- molecule converge || return 1
- sleep 1m
- molecule verify
- molecule destroy
- stage: Integration tests
name: Molecule ACS 6.2.2 Enterprise on Centos 7
env:
MOLECULE_IT_SCENARIO=default
MOLECULE_IT_CONFIG=vars-centos7.yml
- stage: Integration tests
name: Molecule ACS 7.1.1 Enterprise on RHEL8
env:
MOLECULE_IT_SCENARIO=default
MOLECULE_IT_CONFIG=vars-rhel8.yml
- stage: Integration tests
name: Molecule ACS 7.1.1 Enterprise on Ubuntu 20.04
env:
MOLECULE_IT_SCENARIO=default
MOLECULE_IT_CONFIG=vars-ubuntu2004.yml
- stage: Integration tests
name: Molecule ACS 7.1.1 Community on RHEL8
env: #pragma: allowlist secret
NEXUS_USERNAME=
NEXUS_PASSWORD=
MOLECULE_IT_SCENARIO=default
MOLECULE_IT_CONFIG=vars-rhel8-community.yml
- stage: Integration tests
name: Molecule ACS 7.1.1 Enterprise on multiple RHEL8
env:
MOLECULE_IT_SCENARIO=multimachine
MOLECULE_IT_CONFIG=vars.yml
- stage: Release Stage
name: Release
script:
- scripts/generate-zip.sh
# Travis CI runner work on DETACHED HEAD, so we need to checkout the branch
- git checkout -B "${TRAVIS_BRANCH}"
- git config --local user.email "[email protected]"
- export VERSION=`cat VERSION`
- echo "Tagging repository with v$VERSION..."
- export GIT_TAG="v$VERSION"
- git tag $GIT_TAG -a -m "Generated tag from TravisCI for build $TRAVIS_BUILD_NUMBER"
- git push https://[email protected]/Alfresco/alfresco-ansible-deployment $GIT_TAG
- git tag -d latest
- git tag -a -m "current latest -> $GIT_TAG" -f latest ${GIT_TAG}^{}
- for ref in ':refs/tags/latest' 'latest'; do git push https://[email protected]/Alfresco/alfresco-ansible-deployment $ref; done
- curl -F "r=releases" -F "g=org.alfresco" -F "a=alfresco-ansible-deployment" -F "v=${VERSION}" -F "p=zip" -F "file=@dist/alfresco-ansible-deployment-${VERSION}.zip" -u "$NEXUS_USERNAME:$NEXUS_PASSWORD" https://artifacts.alfresco.com/nexus/service/local/artifact/maven/content
deploy:
provider: s3
access_key_id: "${STAGING_AWS_ACCESS_KEY}"
secret_access_key: "${STAGING_AWS_SECRET_KEY}"
bucket: "${S3_STAGING_BUCKET}"
region: "eu-west-1"
cleanup: false
local_dir: dist
glob: "*.zip"
upload-dir: "enterprise/alfresco-ansible-deployment"