-
Notifications
You must be signed in to change notification settings - Fork 124
/
.travis.yml
346 lines (305 loc) · 9.05 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
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
language: ruby
cache: bundler
stages:
- name: before-merge
if: type IN (push, pull_request)
- name: after-merge
if: type IN (api, cron)
- name: platform-cleanup
if: type IN (cron)
- name: gem-release
if: branch = master AND type = push
- name: gem-smoke-test
if: branch = master AND type = push
git:
depth: false # this is needed for pronto
jobs:
allow_failures:
- rvm: jruby-9.1.14
include:
# BEFORE MERGE
- name: pronto code review
stage: before-merge
script: |
git remote add upstream https://github.com/gooddata/gooddata-ruby.git
git fetch upstream develop
failed=0
PRONTO_FLAY_MASS_THRESHOLD=50 bundle exec pronto run -c upstream/develop --exit-code lib || failed=1
PRONTO_FLAY_MASS_THRESHOLD=100 bundle exec pronto run -c upstream/develop --exit-code spec || failed=1
if [ "$failed" -ne 0 ] ; then
exit 1
fi
# UNIT TESTS ON LINUX IN ALL SUPPORTED RUBY VERSIONS
- name: unit tests 2.3
stage: before-merge
script: bundle exec rake test:unit
rvm: 2.3
- name: unit tests 2.4
stage: before-merge
script: bundle exec rake test:unit
rvm: 2.4
- name: unit tests 2.5
stage: before-merge
script: bundle exec rake test:unit
rvm: 2.5
- name: unit tests 2.6
stage: before-merge
script: bundle exec rake test:unit
rvm: 2.6
- name: unit tests jruby-9.1.14
stage: before-merge
script: bundle exec rake test:unit
rvm: jruby-9.1.14
jdk: openjdk8
- name: sdk integration (vcr) tests - base
stage: before-merge
script: bundle exec rake test:sdk
env: VCR_RECORD_MODE=none
rvm: 2.3
- name: sdk integration (vcr) tests - project
stage: before-merge
script: bundle exec rake test:project
env: VCR_RECORD_MODE=none
rvm: 2.3
- name: lcm integration (vcr) tests - e2e
stage: before-merge
script: bundle exec rspec spec/lcm/integration/spec/e2e/lcm_end_to_end_spec.rb
env:
- VCR_RECORD_MODE=none
rvm: 2.3
# AFTER MERGE
# staging 1
- &lcm-integration-e2e-tests
name: staging1 - lcm integration-e2e tests
stage: after-merge
script: |
bundle exec rake -f lcm.rake docker:build
bundle exec rake -f lcm.rake docker:bundle
bundle exec rake -f lcm.rake test:docker:integration-e2e
env:
- VCR_ON=false
- GD_ENV=staging
- GD_MAX_RETRY=2
rvm: jruby-9.1.14
jdk: openjdk8
- &lcm-integration-release-tests
name: staging1 - lcm integration-release tests
stage: after-merge
script: |
bundle exec rake -f lcm.rake docker:build
bundle exec rake -f lcm.rake docker:bundle
bundle exec rake -f lcm.rake test:docker:integration-release
env:
- VCR_ON=false
- GD_ENV=staging
- GD_MAX_RETRY=2
rvm: jruby-9.1.14
jdk: openjdk8
- &lcm-integration-others-tests
name: staging1 - lcm integration-others tests
stage: after-merge
script: |
bundle exec rake -f lcm.rake docker:build
bundle exec rake -f lcm.rake docker:bundle
bundle exec rake -f lcm.rake test:docker:integration-others
env:
- VCR_ON=false
- GD_ENV=staging
- GD_MAX_RETRY=2
rvm: jruby-9.1.14
jdk: openjdk8
- &lcm-slow-tests
name: staging1 - lcm slow tests
stage: after-merge
script:
- sudo keytool -importcert -alias gooddata-2008 -file "./data/2008.crt" -keystore $JAVA_HOME/jre/lib/security/cacerts -trustcacerts -storepass 'changeit' -noprompt
- sudo keytool -importcert -alias gooddata-int -file "./data/new_ca.cer" -keystore $JAVA_HOME/jre/lib/security/cacerts -trustcacerts -storepass 'changeit' -noprompt
- sudo keytool -importcert -alias gooddata-prod -file "data/new_prodgdc_ca.crt" -keystore $JAVA_HOME/jre/lib/security/cacerts -trustcacerts -storepass 'changeit' -noprompt
- bundle exec rake -f lcm.rake test:slow
env:
- VCR_ON=false
- GD_ENV=staging
rvm: jruby-9.1.14
jdk: openjdk8
- &userprov-tests
name: staging1 - user provisioning tests
stage: after-merge
script: |
bundle exec rake -f lcm.rake docker:build
bundle exec rake -f lcm.rake docker:bundle
bundle exec rake -f lcm.rake test:docker:userprov
env:
- VCR_ON=false
- GD_ENV=staging
rvm: jruby-9.1.14
jdk: openjdk8
- &bricks-smoke-tests
name: staging1 - bricks smoke tests
stage: after-merge
script:
- sudo keytool -importcert -alias gooddata-2008 -file "./data/2008.crt" -keystore $JAVA_HOME/jre/lib/security/cacerts -trustcacerts -storepass 'changeit' -noprompt
- sudo keytool -importcert -alias gooddata-int -file "./data/new_ca.cer" -keystore $JAVA_HOME/jre/lib/security/cacerts -trustcacerts -storepass 'changeit' -noprompt
- sudo keytool -importcert -alias gooddata-prod -file "data/new_prodgdc_ca.crt" -keystore $JAVA_HOME/jre/lib/security/cacerts -trustcacerts -storepass 'changeit' -noprompt
- bundle exec rake -f lcm.rake test:smoke
env:
- GD_ENV=staging
- VCR_ON=false
rvm: jruby-9.1.14
jdk: openjdk8
- &sdk-integration-tests
name: staging1 - sdk integration tests - base
stage: after-merge
script: bundle exec rake test:sdk
env:
- VCR_ON=false
- GD_ENV=staging
rvm: jruby-9.1.14
jdk: openjdk8
- &sdk-integration-tests-project
name: staging1 - sdk integration tests - project
stage: after-merge
script: bundle exec rake test:project
env:
- VCR_ON=false
- GD_ENV=staging
rvm: jruby-9.1.14
jdk: openjdk8
# staging 2
- <<: *lcm-integration-e2e-tests
name: staging2 - lcm integration-e2e tests
env:
- GD_ENV=testing
- VCR_ON=false
- GD_MAX_RETRY=2
- <<: *lcm-integration-release-tests
name: staging2 - lcm integration-release tests
env:
- GD_ENV=testing
- VCR_ON=false
- GD_MAX_RETRY=2
- <<: *lcm-integration-others-tests
name: staging2 - lcm integration-others tests
env:
- GD_ENV=testing
- VCR_ON=false
- GD_MAX_RETRY=2
- <<: *lcm-slow-tests
name: staging2 - lcm slow tests
env:
- GD_ENV=testing
- VCR_ON=false
- <<: *userprov-tests
name: staging2 - lcm user provisioning tests
env:
- GD_ENV=testing
- VCR_ON=false
- <<: *bricks-smoke-tests
name: staging2 - bricks smoke tests
env:
- GD_ENV=testing
- VCR_ON=false
- <<: *sdk-integration-tests
name: staging2 - sdk integration tests - base
env:
- GD_ENV=testing
- VCR_ON=false
- <<: *sdk-integration-tests-project
name: staging2 - sdk integration tests - project
env:
- GD_ENV=testing
- VCR_ON=false
# staging 3
- <<: *lcm-integration-e2e-tests
name: staging3 - lcm integration-e2e tests
env:
- GD_ENV=development
- VCR_ON=false
- GD_MAX_RETRY=2
- <<: *lcm-integration-release-tests
name: staging3 - lcm integration-release tests
env:
- GD_ENV=development
- VCR_ON=false
- GD_MAX_RETRY=2
- <<: *lcm-integration-others-tests
name: staging3 - lcm integration-others tests
env:
- GD_ENV=development
- VCR_ON=false
- GD_MAX_RETRY=2
- <<: *lcm-slow-tests
name: staging3 - lcm slow tests
env:
- GD_ENV=development
- VCR_ON=false
- <<: *userprov-tests
name: staging3 - lcm user provisioning tests
env:
- GD_ENV=development
- VCR_ON=false
- <<: *bricks-smoke-tests
name: staging3 - bricks smoke tests
env:
- GD_ENV=development
- VCR_ON=false
- <<: *sdk-integration-tests
name: staging3 - sdk integration tests - base
env:
- GD_ENV=development
- VCR_ON=false
- <<: *sdk-integration-tests-project
name: staging3 - sdk integration tests - project
env:
- GD_ENV=development
- VCR_ON=false
# cleanups
- &cleanup
stage: after-merge
name: staging1 - test environment clean-up
script: travis_wait 30 bundle exec ruby bin/test_projects_cleanup.rb -f
env:
- GD_ENV=staging
- GD_MAX_RETRY=2
- <<: *cleanup
name: staging2 - test environment clean-up
env:
- GD_ENV=testing
- GD_MAX_RETRY=2
- <<: *cleanup
name: staging3 - test environment clean-up
env:
- GD_ENV=development
- GD_MAX_RETRY=2
# AFTER MERGE UNIT TESTS ON ALTERNATIVE PLATFORM
- stage: gem-release
name: deploy MRI gem
rvm: 2.3
deploy:
provider: rubygems
gem: gooddata
api_key: $RUBYGEMS_API_KEY
- stage: gem-release
name: deploy JRuby gem
rvm: jruby-9.1.14
jdk: openjdk8
script: |
echo -e "---\n:rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials
chmod 0600 ~/.gem/credentials
bundle exec rake gem:release
- &gem-smoke-test
stage: gem-smoke-test
name: smoke test MRI gem
rvm: 2.3
script: |
gem install gooddata
ruby -e "require 'gooddata';GoodData.version"
- <<: *gem-smoke-test
name: smoke test JRuby gem
rvm: jruby-9.1.14
jdk: openjdk8
notifications:
email:
recipients:
secure: AMTssALc5Qt4ApAoI7gCmqP3d7AL0dGyZ+DsxYYlas2T0tjXdOH97XlY2jRzFSxZU1P3JKJkjHLmxu0m908Q28SQVcdBlK29Ofyl2pwGnniExY4wdQJLmqNW9eKa2dmSMUsntR6DryNThKVn9mqUACdXgpT8X2CnQl/DWMGpo80=
on_success: always
on_failure: always