forked from gooddata/gooddata-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
225 lines (199 loc) · 5.67 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
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:
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
bundle exec pronto run -c upstream/develop --exit-code
- name: unit tests
stage: before-merge
script: bundle exec rake test:unit
rvm:
- 2.2
- 2.3
- 2.4
- 2.5
- jruby-1.7.19
- jruby-9.1.5
- jruby-9.1.7
- jruby-9.1.14
- 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/lcm_end_to_end_spec.rb
env:
- VCR_RECORD_MODE=none
- GD_ENV=development
rvm: 2.3
# AFTER MERGE
# staging 1
- &lcm-integration-tests
name: staging1 - lcm integration 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
env:
- VCR_ON=false
- GD_ENV=staging
rvm: jruby-9.1.14
- &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
- &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
- &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
- &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
# staging 2
- <<: *lcm-integration-tests
name: staging2 - lcm integration tests
env:
- GD_ENV=testing
- VCR_ON=false
- <<: *lcm-slow-tests
name: staging2 - lcm slow tests
env:
- GD_ENV=staging
- VCR_ON=false
- <<: *userprov-tests
name: staging2 - lcm user provisioning tests
env:
- GD_ENV=staging
- 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-tests
name: staging3 - lcm integration tests
env:
- GD_ENV=development
- VCR_ON=false
- <<: *lcm-slow-tests
name: staging3 - lcm slow tests
env:
- GD_ENV=staging
- VCR_ON=false
- <<: *userprov-tests
name: staging3 - lcm user provisioning tests
env:
- GD_ENV=staging
- 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: bundle exec ruby bin/test_projects_cleanup.rb -f
env: GD_ENV=staging
- <<: *cleanup
name: staging2 - test environment clean-up
env: GD_ENV=testing
- <<: *cleanup
name: staging3 - test environment clean-up
env: GD_ENV=development
- 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
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
notifications:
email:
recipients:
secure: AMTssALc5Qt4ApAoI7gCmqP3d7AL0dGyZ+DsxYYlas2T0tjXdOH97XlY2jRzFSxZU1P3JKJkjHLmxu0m908Q28SQVcdBlK29Ofyl2pwGnniExY4wdQJLmqNW9eKa2dmSMUsntR6DryNThKVn9mqUACdXgpT8X2CnQl/DWMGpo80=
on_success: always
on_failure: always