Unverified Commit 23a68841 authored by Denis_P's avatar Denis_P 🏑 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 932e7b61
Pipeline #123350 skipped
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
# setting DEPLOY_TAG will only deploy the tagged image # 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, # 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. # which executes the job.
stages: stages:
...@@ -62,33 +62,17 @@ default: ...@@ -62,33 +62,17 @@ default:
- cargo --version - cargo --version
- sccache -s - 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 .rules-test: &rules-test
# these jobs run always* # these jobs run always*
rules: rules:
- if: $PIPELINE == "rococo" - if: $CI_COMMIT_REF_NAME == "rococo-v1"
when: never when: never
- when: always - when: always
.pr-only: &rules-pr-only .pr-only: &rules-pr-only
# these jobs run only on PRs # these jobs run only on PRs
rules: rules:
- if: $PIPELINE == "rococo" - if: $CI_COMMIT_REF_NAME == "rococo-v1"
when: never when: never
- if: $CI_PIPELINE_SOURCE == "schedule" - if: $CI_PIPELINE_SOURCE == "schedule"
when: never when: never
...@@ -202,28 +186,19 @@ build-linux-release: ...@@ -202,28 +186,19 @@ build-linux-release:
<<: *collect-artifacts <<: *collect-artifacts
<<: *docker-env <<: *docker-env
<<: *compiler-info <<: *compiler-info
variables:
EXTRA_FLAGS: ""
rules: rules:
# .rules-test with manual on PRs # extra features when building on `rococo-v1` branch and manual build on PRs
- if: $PIPELINE == "rococo" - if: $CI_COMMIT_REF_NAME == "rococo-v1"
when: never variables:
EXTRA_FLAGS: "--features=real-overseer"
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
when: manual when: manual
allow_failure: true allow_failure: true
- when: always - when: always
script: script:
- time cargo build --release --verbose - time cargo build --release --verbose ${EXTRA_FLAGS}
- 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
- sccache -s - sccache -s
- *pack-artifacts - *pack-artifacts
...@@ -270,41 +245,30 @@ generate-impl-guide: ...@@ -270,41 +245,30 @@ generate-impl-guide:
# only VERSION information is needed for the deployment # only VERSION information is needed for the deployment
- find ./artifacts/ -depth -not -name VERSION -not -name artifacts -delete - find ./artifacts/ -depth -not -name VERSION -not -name artifacts -delete
publish-docker-polkadot: publish-dockerhub:
stage: publish stage: publish
<<: *build-push-docker-image <<: *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: # Don't run on releases - this is handled by the Github Action here:
# .github/workflows/publish-docker-release.yml # .github/workflows/publish-docker-release.yml
rules: - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
- if: $PIPELINE == "rococo"
when: never 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 == "schedule"
- if: $CI_PIPELINE_SOURCE == "web" - if: $CI_PIPELINE_SOURCE == "web"
- if: $CI_COMMIT_REF_NAME == "master" - if: $CI_COMMIT_REF_NAME == "master"
needs: needs:
- job: build-linux-release - job: build-linux-release
artifacts: true 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: publish-s3-release:
stage: publish stage: publish
<<: *rules-build
needs: needs:
- job: build-linux-release - job: build-linux-release
artifacts: true artifacts: true
...@@ -314,6 +278,14 @@ publish-s3-release: ...@@ -314,6 +278,14 @@ publish-s3-release:
GIT_STRATEGY: none GIT_STRATEGY: none
BUCKET: "releases.parity.io" BUCKET: "releases.parity.io"
PREFIX: "polkadot/${ARCH}-${DOCKER_OS}" 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: before_script:
- *check-versions - *check-versions
script: script:
...@@ -343,7 +315,14 @@ publish-s3-release: ...@@ -343,7 +315,14 @@ publish-s3-release:
deploy-polkasync-kusama: deploy-polkasync-kusama:
stage: deploy 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: variables:
POLKADOT_CI_COMMIT_NAME: "${CI_COMMIT_REF_NAME}" POLKADOT_CI_COMMIT_NAME: "${CI_COMMIT_REF_NAME}"
POLKADOT_CI_COMMIT_REF: "${CI_COMMIT_REF}" POLKADOT_CI_COMMIT_REF: "${CI_COMMIT_REF}"
......
This diff is collapsed.
Supports Markdown
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