1
1
stages :
2
- - lint
3
- - check
4
2
- test
5
3
- build
6
4
- publish
@@ -13,8 +11,9 @@ variables:
13
11
CARGO_INCREMENTAL : 0
14
12
ARCH : " x86_64"
15
13
CI_IMAGE : " paritytech/bridges-ci:production"
16
- BUILDAH_IMAGE : " quay.io/buildah/stable:v1.27"
17
14
RUST_BACKTRACE : full
15
+ BUILDAH_IMAGE : " quay.io/buildah/stable:v1.29"
16
+ BUILDAH_COMMAND : " buildah --storage-driver overlay2"
18
17
19
18
default :
20
19
cache : {}
@@ -50,23 +49,14 @@ default:
50
49
51
50
.test-refs : &test-refs
52
51
rules :
53
- # FIXME: This is the cause why pipelines wouldn't start. The problem might be in our custom
54
- # mirroring. This should be investigated further, but for now let's have the working
55
- # pipeline.
56
- # - if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH
57
- # changes:
58
- # - '**.md'
59
- # - diagrams/*
60
- # - docs/*
61
- # when: never
62
52
- if : $CI_PIPELINE_SOURCE == "pipeline"
63
53
- if : $CI_PIPELINE_SOURCE == "web"
64
54
- if : $CI_PIPELINE_SOURCE == "schedule"
65
55
- if : $CI_COMMIT_REF_NAME == "master"
66
56
- if : $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
67
57
- if : $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
68
58
69
- .build -refs : &build -refs
59
+ .publish -refs : &publish -refs
70
60
rules :
71
61
# won't run on the CI image update pipeline
72
62
- if : $CI_PIPELINE_SOURCE == "pipeline"
@@ -78,6 +68,12 @@ default:
78
68
# this job runs only on nightly pipeline with the mentioned variable, against `master` branch
79
69
- if : $CI_PIPELINE_SOURCE == "schedule" && $PIPELINE == "nightly"
80
70
71
+ .nightly-test : &nightly-test
72
+ rules :
73
+ # 2. another is triggered by scripts repo $CI_PIPELINE_SOURCE == "pipeline" it's for the CI image
74
+ # update, it also runs all the nightly checks.
75
+ - if : $CI_PIPELINE_SOURCE == "pipeline"
76
+
81
77
.deploy-refs : &deploy-refs
82
78
rules :
83
79
- if : $CI_PIPELINE_SOURCE == "pipeline"
@@ -89,16 +85,12 @@ default:
89
85
- if : $CI_COMMIT_REF_NAME =~ /^v[0-9]{4}-[0-9]{2}-[0-9]{2}.*$/ # i.e. v2021-09-27, v2021-09-27-1
90
86
when : manual
91
87
92
- .nightly-test : &nightly-test
93
- rules :
94
- # 2. another is triggered by scripts repo $CI_PIPELINE_SOURCE == "pipeline" it's for the CI image
95
- # update, it also runs all the nightly checks.
96
- - if : $CI_PIPELINE_SOURCE == "pipeline"
97
88
98
- # ### stage: lint
89
+
90
+ # ### stage: test
99
91
100
92
clippy-nightly :
101
- stage : lint
93
+ stage : test
102
94
<< : *docker-env
103
95
<< : *test-refs
104
96
variables :
@@ -108,23 +100,21 @@ clippy-nightly:
108
100
- SKIP_WASM_BUILD=1 cargo +nightly clippy --all-targets -- -A clippy::redundant_closure -A clippy::derive-partial-eq-without-eq -A clippy::or_fun_call
109
101
110
102
fmt :
111
- stage : lint
103
+ stage : test
112
104
<< : *docker-env
113
105
<< : *test-refs
114
106
script :
115
107
- cargo +nightly fmt --all -- --check
116
108
117
109
spellcheck :
118
- stage : lint
110
+ stage : test
119
111
<< : *docker-env
120
112
<< : *test-refs
121
113
script :
122
114
- cargo spellcheck check --cfg=.config/spellcheck.toml --checkers hunspell -m 1 $(find . -type f -name '*.rs' ! -path "./target/*" ! -name 'codegen_runtime.rs' ! -name 'weights.rs')
123
115
124
- # ### stage: check
125
-
126
116
check :
127
- stage : check
117
+ stage : test
128
118
<< : *docker-env
129
119
<< : *test-refs
130
120
script : &check-script
@@ -135,15 +125,13 @@ check:
135
125
- SKIP_WASM_BUILD=1 time cargo check -p millau-runtime --locked --features runtime-benchmarks --verbose
136
126
137
127
check-nightly :
138
- stage : check
128
+ stage : test
139
129
<< : *docker-env
140
130
<< : *nightly-test
141
131
script :
142
132
- rustup default nightly
143
133
- *check-script
144
134
145
- # ### stage: test
146
-
147
135
test :
148
136
stage : test
149
137
<< : *docker-env
@@ -225,12 +213,17 @@ partial-repo-pallets-build-test:
225
213
# we may live with failing partial repo build, it is just a signal for us
226
214
allow_failure : true
227
215
228
- # ### stage: build
229
-
230
216
build :
231
- stage : build
217
+ stage : test
218
+ rules :
219
+ # won't run on the CI image update pipeline
220
+ - if : $CI_PIPELINE_SOURCE == "pipeline"
221
+ when : never
222
+ - if : $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
223
+ - if : $CI_COMMIT_REF_NAME =~ /^v[0-9]{4}-[0-9]{2}-[0-9]{2}.*$/ # i.e. v2021-09-27, v2021-09-27-1
224
+ - if : $CI_PIPELINE_SOURCE == "schedule" && $PIPELINE == "nightly"
225
+ - if : $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
232
226
<< : *docker-env
233
- << : *build-refs
234
227
<< : *collect-artifacts
235
228
# master
236
229
script : &build-script
@@ -264,10 +257,66 @@ build-nightly:
264
257
265
258
# ### stage: publish
266
259
260
+ # check that images can be built
261
+ .build-image : &build-image
262
+ << : *kubernetes-build
263
+ image : $BUILDAH_IMAGE
264
+ << : *test-refs
265
+ variables : &build-image-variables
266
+ GIT_STRATEGY : none
267
+ DOCKERFILE : ci.Dockerfile
268
+ needs :
269
+ - job : build
270
+ artifacts : true
271
+ script :
272
+ # trim "-build-docker" from job name
273
+ - export DOCKER_IMAGE_NAME="${CI_JOB_NAME::-13}"
274
+ - if [[ "${CI_JOB_NAME::-13}" == "bridges-common-relay" ]]; then
275
+ export BRIDGES_PROJECT="substrate-relay";
276
+ else
277
+ export BRIDGES_PROJECT="${CI_JOB_NAME::-13}";
278
+ fi
279
+ - export IMAGE_NAME=docker.io/paritytech/${DOCKER_IMAGE_NAME}
280
+ - echo "Building ${IMAGE_NAME}"
281
+ - cd ./artifacts
282
+ - $BUILDAH_COMMAND build
283
+ --format=docker
284
+ --build-arg VCS_REF="${CI_COMMIT_SHORT_SHA}"
285
+ --build-arg BUILD_DATE="$(date +%d-%m-%Y)"
286
+ --build-arg PROJECT="${BRIDGES_PROJECT}"
287
+ --build-arg VERSION="${VERSION}"
288
+ --tag "${IMAGE_NAME}:latest"
289
+ --file "${DOCKERFILE}" .
290
+
291
+ rialto-bridge-node-build-docker :
292
+ stage : publish
293
+ << : *build-image
294
+
295
+ rialto-parachain-collator-build-docker :
296
+ stage : publish
297
+ << : *build-image
298
+
299
+ millau-bridge-node-build-docker :
300
+ stage : publish
301
+ << : *build-image
302
+
303
+ substrate-relay-build-docker :
304
+ stage : publish
305
+ << : *build-image
306
+
307
+ bridges-common-relay-build-docker :
308
+ stage : publish
309
+ << : *build-image
310
+ variables :
311
+ << : *build-image-variables
312
+ BRIDGES_PROJECT : substrate-relay
313
+ DOCKER_IMAGE_NAME : bridges-common-relay
314
+
315
+ # build and publish images
267
316
.build-push-image : &build-push-image
268
317
<< : *kubernetes-build
269
318
image : $BUILDAH_IMAGE
270
- << : *build -refs
319
+ << : *publish -refs
271
320
variables : &image-variables
272
321
GIT_STRATEGY : none
273
322
DOCKERFILE : ci.Dockerfile
@@ -297,7 +346,7 @@ build-nightly:
297
346
- test "${Docker_Hub_User_Parity}" -a "${Docker_Hub_Pass_Parity}" ||
298
347
( echo "no docker credentials provided"; exit 1 )
299
348
- cd ./artifacts
300
- - buildah bud
349
+ - $BUILDAH_COMMAND build
301
350
--format=docker
302
351
--build-arg VCS_REF="${CI_COMMIT_SHORT_SHA}"
303
352
--build-arg BUILD_DATE="$(date +%d-%m-%Y)"
@@ -310,10 +359,10 @@ build-nightly:
310
359
# The job will success only on the protected branch
311
360
- echo "${Docker_Hub_Pass_Parity}" |
312
361
buildah login --username "${Docker_Hub_User_Parity}" --password-stdin docker.io
313
- - buildah info
314
- - buildah push --format=v2s2 "${IMAGE_NAME}:${VERSION}"
315
- - buildah push --format=v2s2 "${IMAGE_NAME}:sha-${CI_COMMIT_SHORT_SHA}"
316
- - buildah push --format=v2s2 "${IMAGE_NAME}:${FLOATING_TAG}"
362
+ - $BUILDAH_COMMAND info
363
+ - $BUILDAH_COMMAND push --format=v2s2 "${IMAGE_NAME}:${VERSION}"
364
+ - $BUILDAH_COMMAND push --format=v2s2 "${IMAGE_NAME}:sha-${CI_COMMIT_SHORT_SHA}"
365
+ - $BUILDAH_COMMAND push --format=v2s2 "${IMAGE_NAME}:${FLOATING_TAG}"
317
366
after_script :
318
367
- env REGISTRY_AUTH_FILE= buildah logout --all
319
368
@@ -343,7 +392,7 @@ bridges-common-relay:
343
392
344
393
# Publish Docker images description to hub.docker.com
345
394
346
- .publish-docker-image-description : &publish-docker-image-description
395
+ .publish-docker-image-description :
347
396
stage : publish-docker-description
348
397
image : paritytech/dockerhub-description
349
398
variables :
0 commit comments