Newer
Older
# This file is part of .gitlab-ci.yml
# Here are all jobs that are executed during "publish" stage
publish-rustdoc:
stage: publish
extends: .kubernetes-env
variables:
CI_IMAGE: node:18
GIT_DEPTH: 100
RUSTDOCS_DEPLOY_REFS: "master"
rules:
- if: $CI_PIPELINE_SOURCE == "pipeline"
when: never
- if: $CI_PIPELINE_SOURCE == "web" && $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME == "master"
needs:
- job: build-rustdoc
artifacts: true
- job: build-implementers-guide
artifacts: true
script:
# If $CI_COMMIT_REF_NAME doesn't match one of $RUSTDOCS_DEPLOY_REFS space-separated values, we
# exit immediately.
# Putting spaces at the front and back to ensure we are not matching just any substring, but the
# whole space-separated value.
# setup ssh
- eval $(ssh-agent)
- ssh-add - <<< ${GITHUB_SSH_PRIV_KEY}
- mkdir ~/.ssh && touch ~/.ssh/known_hosts
- ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
# Set git config
- git config user.email "[email protected]"
- git config user.name "${GITHUB_USER}"
- git config remote.origin.url "[email protected]:/paritytech/${CI_PROJECT_NAME}.git"
- git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
- git fetch origin gh-pages
# Save README and docs
- cp -r ./crate-docs/ /tmp/doc/
- cp -r ./artifacts/book/ /tmp/
- cp README.md /tmp/doc/
# we don't need to commit changes because we copy docs to /tmp
- git checkout gh-pages --force
# Enable if docs needed for other refs
# Install `index-tpl-crud` and generate index.html based on RUSTDOCS_DEPLOY_REFS
# - which index-tpl-crud &> /dev/null || yarn global add @substrate/index-tpl-crud
# - index-tpl-crud upsert ./index.html ${CI_COMMIT_REF_NAME}
# Ensure the destination dir doesn't exist.
- rm -rf ${CI_COMMIT_REF_NAME}
- mv -f /tmp/doc ${CI_COMMIT_REF_NAME}
# dir for implementors guide
- mkdir -p book
- mv /tmp/book/html/* book/
# Upload files
- git add --all
# `git commit` has an exit code of > 0 if there is nothing to commit.
# This causes GitLab to exit immediately and marks this job failed.
# We don't want to mark the entire job failed if there's nothing to
# publish though, hence the `|| true`.
- git commit -m "___Updated docs for ${CI_COMMIT_REF_NAME}___" ||
echo "___Nothing to commit___"
- git push origin gh-pages --force
after_script:
- rm -rf .git/ ./*
# cumulus
.build-push-image:
image: $BUILDAH_IMAGE
variables:
DOCKERFILE: "" # docker/path-to.Dockerfile
IMAGE_NAME: "" # docker.io/paritypr/image_name
script:
# Exit if the job is not running in a merge queue
- if [[ $CI_COMMIT_REF_NAME != *"gh-readonly-queue"* ]]; then echo "I will run only in a merge queue"; exit 0; fi
- $BUILDAH_COMMAND build
--format=docker
--build-arg VCS_REF="${CI_COMMIT_SHA}"
--build-arg BUILD_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')"
--build-arg IMAGE_NAME="${IMAGE_NAME}"
--tag "$IMAGE_NAME:${DOCKER_IMAGES_VERSION}"
--file ${DOCKERFILE} .
- echo "$PARITYPR_PASS" |
buildah login --username "$PARITYPR_USER" --password-stdin docker.io
- $BUILDAH_COMMAND info
- $BUILDAH_COMMAND push --format=v2s2 "$IMAGE_NAME:${DOCKER_IMAGES_VERSION}"
after_script:
- buildah logout --all
build-push-image-polkadot-parachain-debug:
stage: publish
extends:
- .kubernetes-env
- .common-refs
- .build-push-image
needs:
- job: build-linux-stable-cumulus
artifacts: true
variables:
DOCKERFILE: "docker/dockerfiles/polkadot-parachain/polkadot-parachain-debug_unsigned_injected.Dockerfile"
IMAGE_NAME: "docker.io/paritypr/polkadot-parachain-debug"
build-push-image-test-parachain:
stage: publish
extends:
- .kubernetes-env
- .common-refs
- .build-push-image
needs:
- job: build-test-parachain
artifacts: true
variables:
DOCKERFILE: "docker/dockerfiles/test-parachain_injected.Dockerfile"
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
IMAGE_NAME: "docker.io/paritypr/test-parachain"
# publish-s3:
# stage: publish
# extends:
# - .kubernetes-env
# - .publish-refs
# image: paritytech/awscli:latest
# needs:
# - job: build-linux-stable-cumulus
# artifacts: true
# variables:
# GIT_STRATEGY: none
# BUCKET: "releases.parity.io"
# PREFIX: "cumulus/${ARCH}-${DOCKER_OS}"
# script:
# - echo "___Publishing a binary with debug assertions!___"
# - echo "___VERSION = $(cat ./artifacts/VERSION) ___"
# - aws s3 sync ./artifacts/ s3://${BUCKET}/${PREFIX}/$(cat ./artifacts/VERSION)/
# - echo "___Updating objects in latest path___"
# - aws s3 sync s3://${BUCKET}/${PREFIX}/$(cat ./artifacts/VERSION)/ s3://${BUCKET}/${PREFIX}/latest/
# after_script:
# - aws s3 ls s3://${BUCKET}/${PREFIX}/latest/
# --recursive --human-readable --summarize
# publish-benchmarks-assets-s3: &publish-benchmarks
# stage: publish
# extends:
# - .kubernetes-env
# - .benchmarks-refs
# image: paritytech/awscli:latest
# needs:
# - job: benchmarks-assets
# artifacts: true
# variables:
# GIT_STRATEGY: none
# BUCKET: "releases.parity.io"
# PREFIX: "cumulus/$CI_COMMIT_REF_NAME/benchmarks-assets"
# script:
# - echo "___Publishing benchmark results___"
# - aws s3 sync ./artifacts/ s3://${BUCKET}/${PREFIX}/
# after_script:
# - aws s3 ls s3://${BUCKET}/${PREFIX}/ --recursive --human-readable --summarize
# publish-benchmarks-collectives-s3:
# <<: *publish-benchmarks
# variables:
# GIT_STRATEGY: none
# BUCKET: "releases.parity.io"
# PREFIX: "cumulus/$CI_COMMIT_REF_NAME/benchmarks-collectives"
# needs:
# - job: benchmarks-collectives
# artifacts: true
### Polkadot
build-push-image-polkadot-debug:
stage: publish
extends:
- .kubernetes-env
- .common-refs
- .build-push-image
needs:
- job: build-linux-stable
artifacts: true
variables:
DOCKERFILE: "docker/dockerfiles/polkadot/polkadot_injected_debug.Dockerfile"
IMAGE_NAME: "docker.io/paritypr/polkadot-debug"
build-push-image-colander:
stage: publish
extends:
- .kubernetes-env
- .common-refs
- .build-push-image
needs:
- job: build-test-collators
artifacts: true
variables:
DOCKERFILE: "docker/dockerfiles/collator_injected.Dockerfile"
IMAGE_NAME: "docker.io/paritypr/colander"
build-push-image-malus:
stage: publish
extends:
- .kubernetes-env
- .common-refs
- .build-push-image
needs:
- job: build-malus
artifacts: true
variables:
DOCKERFILE: "docker/dockerfiles/malus_injected.Dockerfile"
IMAGE_NAME: "docker.io/paritypr/malus"
build-push-image-substrate-pr:
stage: publish
extends:
- .kubernetes-env
- .common-refs
- .build-push-image
needs:
- job: build-linux-substrate
artifacts: true
variables:
DOCKERFILE: "docker/dockerfiles/substrate_injected.Dockerfile"
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
IMAGE_NAME: "docker.io/paritypr/substrate"
# old way
# .build-push-image-polkadot:
# before_script:
# # - test -s ./artifacts/VERSION || exit 1
# # - test -s ./artifacts/EXTRATAG || exit 1
# - VERSION="$(cat ./artifacts/VERSION)"
# - EXTRATAG="$(cat ./artifacts/EXTRATAG)"
# - echo "Polkadot version = ${VERSION} (EXTRATAG = ${EXTRATAG})"
# script:
# # - test "$DOCKER_USER" -a "$DOCKER_PASS" ||
# # ( echo "no docker credentials provided"; exit 1 )
# - cd ./artifacts
# - $BUILDAH_COMMAND build
# --format=docker
# --build-arg VCS_REF="${CI_COMMIT_SHA}"
# --build-arg BUILD_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')"
# --build-arg IMAGE_NAME="${IMAGE_NAME}"
# --tag "$IMAGE_NAME:$VERSION"
# --tag "$IMAGE_NAME:$EXTRATAG"
# --file ${DOCKERFILE} .
# # The job will success only on the protected branch
# # - echo "$DOCKER_PASS" |
# # buildah login --username "$DOCKER_USER" --password-stdin docker.io
# # - $BUILDAH_COMMAND info
# # - $BUILDAH_COMMAND push --format=v2s2 "$IMAGE_NAME:$VERSION"
# # - $BUILDAH_COMMAND push --format=v2s2 "$IMAGE_NAME:$EXTRATAG"
# after_script:
# - buildah logout --all
# publish-polkadot-debug-image:
# stage: publish
# image: ${BUILDAH_IMAGE}
# extends:
# - .kubernetes-env
# - .build-push-image-polkadot
# rules:
# - if: $CI_PIPELINE_SOURCE == "web"
# - if: $CI_PIPELINE_SOURCE == "schedule"
# - if: $CI_COMMIT_REF_NAME == "master"
# - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
# - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
# variables:
# GIT_STRATEGY: none
# DOCKER_USER: ${PARITYPR_USER}
# DOCKER_PASS: ${PARITYPR_PASS}
# # docker/dockerfiles/polkadot/polkadot_injected_debug.Dockerfile
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
# DOCKERFILE: polkadot_injected_debug.Dockerfile
# IMAGE_NAME: docker.io/paritypr/polkadot-debug
# needs:
# - job: build-linux-stable
# artifacts: true
# after_script:
# # pass artifacts to the zombienet-tests job
# # https://docs.gitlab.com/ee/ci/multi_project_pipelines.html#with-variable-inheritance
# - echo "PARACHAINS_IMAGE_NAME=${IMAGE_NAME}" > ./artifacts/parachains.env
# - echo "PARACHAINS_IMAGE_TAG=$(cat ./artifacts/EXTRATAG)" >> ./artifacts/parachains.env
# artifacts:
# reports:
# # this artifact is used in zombienet-tests job
# dotenv: ./artifacts/parachains.env
# expire_in: 1 days
# publish-test-collators-image:
# # service image for zombienet
# stage: publish
# extends:
# - .kubernetes-env
# - .build-push-image-polkadot
# - .zombienet-refs
# variables:
# CI_IMAGE: ${BUILDAH_IMAGE}
# GIT_STRATEGY: none
# DOCKER_USER: ${PARITYPR_USER}
# DOCKER_PASS: ${PARITYPR_PASS}
# # docker/dockerfiles/collator_injected.Dockerfile
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
# DOCKERFILE: collator_injected.Dockerfile
# IMAGE_NAME: docker.io/paritypr/colander
# needs:
# - job: build-test-collators
# artifacts: true
# after_script:
# - buildah logout --all
# # pass artifacts to the zombienet-tests job
# - echo "COLLATOR_IMAGE_NAME=${IMAGE_NAME}" > ./artifacts/collator.env
# - echo "COLLATOR_IMAGE_TAG=$(cat ./artifacts/EXTRATAG)" >> ./artifacts/collator.env
# artifacts:
# reports:
# # this artifact is used in zombienet-tests job
# dotenv: ./artifacts/collator.env
# publish-malus-image:
# # service image for Simnet
# stage: publish
# extends:
# - .kubernetes-env
# - .build-push-image-polkadot
# - .zombienet-refs
# variables:
# CI_IMAGE: ${BUILDAH_IMAGE}
# GIT_STRATEGY: none
# DOCKER_USER: ${PARITYPR_USER}
# DOCKER_PASS: ${PARITYPR_PASS}
# # docker/dockerfiles/malus_injected.Dockerfile
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
# DOCKERFILE: malus_injected.Dockerfile
# IMAGE_NAME: docker.io/paritypr/malus
# needs:
# - job: build-malus
# artifacts: true
# after_script:
# - buildah logout "$IMAGE_NAME"
# # pass artifacts to the zombienet-tests job
# - echo "MALUS_IMAGE_NAME=${IMAGE_NAME}" > ./artifacts/malus.env
# - echo "MALUS_IMAGE_TAG=$(cat ./artifacts/EXTRATAG)" >> ./artifacts/malus.env
# artifacts:
# reports:
# # this artifact is used in zombienet-tests job
# dotenv: ./artifacts/malus.env
# substrate
# publish-substrate-image-pr:
# # service image for zombienet
# stage: publish
# extends:
# - .kubernetes-env
# - .build-push-image-polkadot
# - .zombienet-refs
# variables:
# CI_IMAGE: ${BUILDAH_IMAGE}
# GIT_STRATEGY: none
# DOCKER_USER: ${PARITYPR_USER}
# DOCKER_PASS: ${PARITYPR_PASS}
# DOCKERFILE: substrate_injected.Dockerfile
# IMAGE_NAME: docker.io/paritypr/substrate
# needs:
# - job: build-linux-substrate
# artifacts: true
# after_script:
# - buildah logout "$IMAGE_NAME"