@@ -31,14 +31,7 @@ commands:
31
31
- checkout
32
32
33
33
jobs :
34
- validate-charts :
35
- executor : deploy
36
- steps :
37
- - checkout
38
- - run :
39
- command : ./do kubeconform
40
- when : always
41
- - notify_failing_main
34
+ # Images
42
35
scan_postgresql :
43
36
executor : ccc
44
37
steps :
@@ -115,10 +108,70 @@ jobs:
115
108
MAJOR_VERSION : 6.2
116
109
pwd : redis/6.2/debian-10
117
110
111
+ # Charts
112
+ validate-charts :
113
+ executor : deploy
114
+ steps :
115
+ - checkout
116
+ - run :
117
+ command : ./do kubeconform
118
+ when : always
119
+ - notify_failing_main
120
+ package-charts :
121
+ executor : deploy
122
+ steps :
123
+ - checkout
124
+ - run :
125
+ name : Install signing keys
126
+ command : |
127
+ exec 2>/dev/null
128
+
129
+ echo "Importing signing keys"
130
+ echo -n "${SIGNING_KEY_ENCODED}" | base64 --decode >signing_key_decoded.key
131
+ gpg --batch --yes --passphrase "${SIGNING_KEY_PASSPHRASE}" --import signing_key_decoded.key
132
+ rm signing_key_decoded.key
133
+ curl https://keys.openpgp.org/vks/v1/by-fingerprint/"${GPG_ID}" >pub-key.asc
134
+ gpg --import pub-key.asc
135
+ rm pub-key.asc
136
+
137
+ echo "Convert to legacy gpg format per Helm requirements"
138
+ gpg --export >~/.gnupg/pubring.gpg
139
+ gpg --batch --yes --pinentry-mode=loopback --passphrase "${SIGNING_KEY_PASSPHRASE}" --export-secret-keys "${GPG_ID}" >~/.gnupg/secring.gpg
140
+ - run :
141
+ name : Package and sign chart
142
+ command : |
143
+ echo "${SIGNING_KEY_PASSPHRASE}" | ./do package-all-charts ./helm sign --passphrase-file -
144
+ - persist_to_workspace :
145
+ root : .
146
+ paths : [./target]
147
+ - notify_failing_main
148
+ publish-chart :
149
+ executor : deploy
150
+ parameters :
151
+ repo :
152
+ type : string
153
+ chart_name :
154
+ type : string
155
+ steps :
156
+ - checkout
157
+ - attach_workspace :
158
+ at : .
159
+ - run :
160
+ name : Install package_cloud
161
+ command : |
162
+ sudo apt-get update && sudo apt-get install ruby-rubygems -y
163
+ sudo gem install --no-document package_cloud
164
+ - run :
165
+ name : Publish Helm chart
166
+ command : |
167
+ package_cloud push circleci/<< parameters.repo >>/helm/v1 \
168
+ ./target/<< parameters.chart_name >>*.tgz
169
+ - notify_failing_main
170
+
118
171
workflows :
119
172
my-workflow :
120
173
jobs :
121
- - validate-charts
174
+ # Image jobs
122
175
- scan_rabbitmq :
123
176
context : " org-global"
124
177
filters :
@@ -175,3 +228,61 @@ workflows:
175
228
only :
176
229
- main
177
230
- /^server-\d\..+/
231
+
232
+ # Chart jobs
233
+ - validate-charts
234
+ - package-charts :
235
+ context : releng-signing
236
+ requires : [validate-charts]
237
+ # Mongo chart
238
+ - approve-publish-mongo-chart :
239
+ type : approval
240
+ filters :
241
+ branches :
242
+ only : [main, /^server-\d\..+/]
243
+ requires : [package-charts]
244
+ - publish-chart :
245
+ name : publish-mongo-chart
246
+ repo : server-mongo
247
+ chart_name : mongodb
248
+ requires : [approve-publish-mongo-chart]
249
+ context : runner-package-deploy
250
+ # Postgres chart
251
+ - approve-publish-postgres-chart :
252
+ type : approval
253
+ filters :
254
+ branches :
255
+ only : [main, /^server-\d\..+/]
256
+ requires : [package-charts, scan_postgresql]
257
+ - publish-chart :
258
+ name : publish-postgres-chart
259
+ repo : server-postgres
260
+ chart_name : postgresql
261
+ requires : [approve-publish-postgres-chart]
262
+ context : runner-package-deploy
263
+ # RabbitMQ chart
264
+ - approve-publish-rabbitmq-chart :
265
+ type : approval
266
+ filters :
267
+ branches :
268
+ only : [main, /^server-\d\..+/]
269
+ requires : [package-charts, scan_rabbitmq]
270
+ - publish-chart :
271
+ name : publish-rabbitmq-chart
272
+ repo : server-rabbitmq
273
+ chart_name : rabbitmq
274
+ requires : [approve-publish-rabbitmq-chart]
275
+ context : runner-package-deploy
276
+ # Redis chart
277
+ - approve-publish-redis-chart :
278
+ type : approval
279
+ filters :
280
+ branches :
281
+ only : [main, /^server-\d\..+/]
282
+ requires : [package-charts, scan_redis]
283
+ - publish-chart :
284
+ name : publish-redis-chart
285
+ repo : server-redis
286
+ chart_name : redis
287
+ requires : [approve-publish-redis-chart]
288
+ context : runner-package-deploy
0 commit comments