Skip to content
Snippets Groups Projects
Commit 87922b25 authored by Denis_P's avatar Denis_P :field_hockey: Committed by GitHub
Browse files

Publish rococo on every push to `rococo-v1` branch (#2388)

* CI: change manual triggering to auto based on rules [skip ci]

* CI: remove debug comments [skip ci]

* CI: chore

* CI: chore

* CI: cargo update -p sp_io
parent f32922ec
Branches
No related merge requests found
......@@ -6,7 +6,7 @@
# setting DEPLOY_TAG will only deploy the tagged image
#
# please do not add new jobs without "rules:" and "*-env". There are &rules-test for everything,
# &rules-pr-only and &rules-build presets. And "kubernetes-env" with "docker-env" to set a runner
# &rules-pr-only preset. And "kubernetes-env" with "docker-env" to set a runner
# which executes the job.
stages:
......@@ -62,33 +62,17 @@ default:
- cargo --version
- sccache -s
.rules-build: &rules-build
rules:
# Due to https://gitlab.com/gitlab-org/gitlab/-/issues/31264 there's no way to setup a manual
# build job so that publish-docker-rococo would "needs" build-linux-rococo job. This leads
# either to blocked or to forever running pipeline. It was decided to run these jobs from UI
# and on schedule.
#
# $PIPELINE should be passed in https://gitlab.parity.io/parity/polkadot/-/pipeline_schedules
# or other trigger to avoid running these jobs and run just those allowing this variable.
- if: $PIPELINE == "rococo"
when: never
- if: $CI_PIPELINE_SOURCE == "web"
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
.rules-test: &rules-test
# these jobs run always*
rules:
- if: $PIPELINE == "rococo"
- if: $CI_COMMIT_REF_NAME == "rococo-v1"
when: never
- when: always
.pr-only: &rules-pr-only
# these jobs run only on PRs
rules:
- if: $PIPELINE == "rococo"
- if: $CI_COMMIT_REF_NAME == "rococo-v1"
when: never
- if: $CI_PIPELINE_SOURCE == "schedule"
when: never
......@@ -202,28 +186,19 @@ build-linux-release:
<<: *collect-artifacts
<<: *docker-env
<<: *compiler-info
variables:
EXTRA_FLAGS: ""
rules:
# .rules-test with manual on PRs
- if: $PIPELINE == "rococo"
when: never
# extra features when building on `rococo-v1` branch and manual build on PRs
- if: $CI_COMMIT_REF_NAME == "rococo-v1"
variables:
EXTRA_FLAGS: "--features=real-overseer"
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
when: manual
allow_failure: true
- when: always
when: manual
allow_failure: true
- when: always
script:
- time cargo build --release --verbose
- sccache -s
- *pack-artifacts
build-linux-rococo:
stage: build
<<: *collect-artifacts
<<: *docker-env
<<: *compiler-info
rules:
- if: $PIPELINE == "rococo"
script:
- time cargo build --release --verbose --features=real-overseer
- time cargo build --release --verbose ${EXTRA_FLAGS}
- sccache -s
- *pack-artifacts
......@@ -270,41 +245,30 @@ generate-impl-guide:
# only VERSION information is needed for the deployment
- find ./artifacts/ -depth -not -name VERSION -not -name artifacts -delete
publish-docker-polkadot:
publish-dockerhub:
stage: publish
<<: *build-push-docker-image
variables:
GIT_STRATEGY: none
# DOCKERFILE: scripts/docker/Dockerfile
IMAGE_NAME: docker.io/parity/polkadot
rules:
# Don't run on releases - this is handled by the Github Action here:
# .github/workflows/publish-docker-release.yml
rules:
- if: $PIPELINE == "rococo"
- if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
when: never
- if: $CI_COMMIT_REF_NAME == "rococo-v1"
variables:
IMAGE_NAME: docker.io/parity/rococo
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_PIPELINE_SOURCE == "web"
- if: $CI_COMMIT_REF_NAME == "master"
needs:
- job: build-linux-release
artifacts: true
variables:
GIT_STRATEGY: none
# DOCKERFILE: scripts/docker/Dockerfile
IMAGE_NAME: docker.io/parity/polkadot
publish-docker-rococo:
stage: publish
<<: *build-push-docker-image
rules:
- if: $PIPELINE == "rococo"
needs:
- job: build-linux-rococo
artifacts: true
variables:
GIT_STRATEGY: none
# DOCKERFILE: scripts/docker/Dockerfile
IMAGE_NAME: docker.io/parity/rococo
publish-s3-release:
stage: publish
<<: *rules-build
needs:
- job: build-linux-release
artifacts: true
......@@ -314,6 +278,14 @@ publish-s3-release:
GIT_STRATEGY: none
BUCKET: "releases.parity.io"
PREFIX: "polkadot/${ARCH}-${DOCKER_OS}"
rules:
- if: $CI_COMMIT_REF_NAME == "rococo-v1"
variables:
PREFIX: "rococo/${ARCH}-${DOCKER_OS}"
- if: $CI_PIPELINE_SOURCE == "web"
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
before_script:
- *check-versions
script:
......@@ -343,7 +315,14 @@ publish-s3-release:
deploy-polkasync-kusama:
stage: deploy
<<: *rules-build
rules:
# former .rules-build
- if: $CI_COMMIT_REF_NAME == "rococo-v1"
when: never
- if: $CI_PIPELINE_SOURCE == "web"
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
variables:
POLKADOT_CI_COMMIT_NAME: "${CI_COMMIT_REF_NAME}"
POLKADOT_CI_COMMIT_REF: "${CI_COMMIT_REF}"
......
This diff is collapsed.
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment