@@ -37,38 +37,50 @@ commands:
37
37
parameters :
38
38
ruby-image :
39
39
type : string
40
+ gemspec-file :
41
+ type : string
42
+ path :
43
+ type : string
40
44
steps :
41
45
- restore_cache :
42
46
name : Restoring Gem Cache
43
47
keys :
44
- - &cache-key gem-cache-{{ checksum "influxdb-client. gemspec" }}-<< parameters.ruby-image >>
45
- - gem-cache-{{ checksum "influxdb-client. gemspec" }}
48
+ - &cache-key gem-cache-{{ checksum "<< parameters.path >>/<< parameters. gemspec-file >> " }}-<< parameters.ruby-image >>
49
+ - gem-cache-{{ checksum "<< parameters.path >>/<< parameters. gemspec-file >> " }}
46
50
- gem-cache-
47
51
- run :
48
52
name : Install dependencies
49
53
command : |
54
+ cd << parameters.path >>
50
55
gem install bundler
51
56
bundle config set path 'vendor/bundle'
52
57
bundle install --jobs=4 --retry=3
53
58
- run :
54
59
name : Static code analyze
55
60
command : |
61
+ cd << parameters.path >>
56
62
bundle exec rake rubocop
57
63
- run :
58
64
name : Run tests
59
65
command : |
66
+ cd << parameters.path >>
60
67
export MINITEST_REPORTER=JUnitReporter
61
68
bundle exec rake test
62
69
- save_cache :
63
70
name : Saving Gem Cache
64
71
key : *cache-key
65
72
paths :
66
- - . /vendor/bundle
73
+ - << parameters.path >> /vendor/bundle
67
74
when : always
75
+ - storing-test-results :
76
+ path : << parameters.path >>
68
77
storing-test-results :
78
+ parameters :
79
+ path :
80
+ type : string
69
81
steps :
70
82
- store_test_results :
71
- path : test/reports
83
+ path : << parameters.path >>/ test/reports
72
84
73
85
jobs :
74
86
tests-ruby :
79
91
influxdb-image :
80
92
type : string
81
93
default : &default-influxdb-image "influxdb:v2.0.4"
94
+ gemspec-file :
95
+ type : string
96
+ default : influxdb-client.gemspec
97
+ path :
98
+ type : string
99
+ default : .
82
100
docker :
83
101
- image : << parameters.ruby-image >>
84
102
- image : &influx-image quay.io/influxdb/<< parameters.influxdb-image >>
@@ -88,11 +106,17 @@ jobs:
88
106
- prepare
89
107
- test :
90
108
ruby-image : << parameters.ruby-image >>
91
- - storing-test-results
109
+ gemspec-file : << parameters.gemspec-file >>
110
+ path : << parameters.path >>
92
111
93
112
deploy-preview :
94
113
docker :
95
114
- image : *default-ruby-image
115
+ parameters :
116
+ gemspec-file :
117
+ type : string
118
+ path :
119
+ type : string
96
120
steps :
97
121
- run :
98
122
name : Early return if this build is from a forked repository
@@ -108,40 +132,95 @@ jobs:
108
132
- run :
109
133
name : Build a Gem bundle
110
134
command : |
111
- gem build influxdb-client.gemspec
135
+ cd << parameters.path >>
136
+ gem build << parameters.gemspec-file >>
112
137
- run :
113
138
name : Deploy pre-release into https://rubygems.org
114
139
command : |
140
+ cd << parameters.path >>
115
141
gem push influxdb-client-*.pre.$CIRCLE_BUILD_NUM.gem
116
142
workflows :
117
143
version : 2
118
144
build :
119
145
jobs :
120
146
- tests-ruby :
121
- name : ruby-3.0
147
+ name : client-r3.0
148
+ ruby-image : " circleci/ruby:3.0-buster"
149
+ - tests-ruby :
150
+ name : APIs-r3.0
122
151
ruby-image : " circleci/ruby:3.0-buster"
152
+ gemspec-file : influxdb-client-apis.gemspec
153
+ path : ./apis
154
+ requires :
155
+ - client-r3.0
123
156
- tests-ruby :
124
- name : ruby-2 .7
157
+ name : client-r2 .7
125
158
ruby-image : " circleci/ruby:2.7-buster"
126
159
- tests-ruby :
127
- name : ruby-2.6
160
+ name : APIs-r2.7
161
+ ruby-image : " circleci/ruby:2.7-buster"
162
+ gemspec-file : influxdb-client-apis.gemspec
163
+ path : ./apis
164
+ requires :
165
+ - client-r2.7
128
166
- tests-ruby :
129
- name : ruby-2.6-nightly
167
+ name : client-r2.6
168
+ - tests-ruby :
169
+ name : APIs-r2.6
170
+ gemspec-file : influxdb-client-apis.gemspec
171
+ path : ./apis
172
+ requires :
173
+ - client-r2.6
174
+ - tests-ruby :
175
+ name : client-r2.6-nightly
176
+ influxdb-image : " influxdb2:nightly"
177
+ - tests-ruby :
178
+ name : APIs-r2.6-nightly
130
179
influxdb-image : " influxdb2:nightly"
180
+ gemspec-file : influxdb-client-apis.gemspec
181
+ path : ./apis
182
+ requires :
183
+ - client-r2.6-nightly
131
184
- tests-ruby :
132
- name : ruby-2 .5
185
+ name : client-r2 .5
133
186
ruby-image : " circleci/ruby:2.5-stretch"
134
187
- tests-ruby :
135
- name : ruby-2.4
188
+ name : APIs-r2.5
189
+ ruby-image : " circleci/ruby:2.5-stretch"
190
+ gemspec-file : influxdb-client-apis.gemspec
191
+ path : ./apis
192
+ requires :
193
+ - client-r2.5
194
+ - tests-ruby :
195
+ name : client-r2.4
136
196
ruby-image : " circleci/ruby:2.4-stretch"
197
+ - tests-ruby :
198
+ name : APIs-r2.4
199
+ ruby-image : " circleci/ruby:2.4-stretch"
200
+ gemspec-file : influxdb-client-apis.gemspec
201
+ path : ./apis
202
+ requires :
203
+ - client-r2.4
204
+ - deploy-preview :
205
+ name : Deploy Client
206
+ gemspec-file : influxdb-client.gemspec
207
+ path : .
208
+ requires :
209
+ - APIs-r3.0
210
+ - APIs-r2.7
211
+ - APIs-r2.6
212
+ - APIs-r2.6-nightly
213
+ - APIs-r2.5
214
+ - APIs-r2.4
215
+ filters :
216
+ branches :
217
+ only : master
137
218
- deploy-preview :
219
+ name : Deploy APIs
220
+ gemspec-file : influxdb-client-apis.gemspec
221
+ path : ./apis
138
222
requires :
139
- - ruby-3.0
140
- - ruby-2.7
141
- - ruby-2.6
142
- - ruby-2.6-nightly
143
- - ruby-2.5
144
- - ruby-2.4
223
+ - Deploy Client
145
224
filters :
146
225
branches :
147
226
only : master
0 commit comments