Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Publish rococo on every push to rococo-v1 branch #2388

Merged
merged 7 commits into from
Feb 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 39 additions & 60 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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}"
Expand Down
Loading