mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 22:11:02 +00:00
CI: build an image and trigger simnet (#2643)
* CI: build an image and trigger simnet * CI: think of a funny name * CI: fix the artifact * CI: address the bug with .env * CI: some explanation
This commit is contained in:
+61
-33
@@ -148,23 +148,6 @@ check-runtime-benchmarks:
|
|||||||
- ./scripts/gitlab/check_runtime_benchmarks.sh
|
- ./scripts/gitlab/check_runtime_benchmarks.sh
|
||||||
- sccache -s
|
- sccache -s
|
||||||
|
|
||||||
#### stage: build
|
|
||||||
|
|
||||||
check-transaction-versions:
|
|
||||||
image: node:15
|
|
||||||
stage: build
|
|
||||||
<<: *rules-test
|
|
||||||
<<: *docker-env
|
|
||||||
needs:
|
|
||||||
- job: test-linux-stable
|
|
||||||
artifacts: true
|
|
||||||
before_script:
|
|
||||||
- apt-get -y update; apt-get -y install jq lsof
|
|
||||||
- npm install --ignore-scripts -g @polkadot/metadata-cmp
|
|
||||||
- git fetch origin release
|
|
||||||
script:
|
|
||||||
- scripts/gitlab/check_extrinsics_ordering.sh
|
|
||||||
|
|
||||||
.pack-artifacts: &pack-artifacts
|
.pack-artifacts: &pack-artifacts
|
||||||
- mkdir -p ./artifacts
|
- mkdir -p ./artifacts
|
||||||
- VERSION="${CI_COMMIT_REF_NAME}" # will be tag or branch name
|
- VERSION="${CI_COMMIT_REF_NAME}" # will be tag or branch name
|
||||||
@@ -183,7 +166,7 @@ check-transaction-versions:
|
|||||||
- cp -r scripts/docker/* ./artifacts
|
- cp -r scripts/docker/* ./artifacts
|
||||||
|
|
||||||
build-linux-release:
|
build-linux-release:
|
||||||
stage: build
|
stage: test
|
||||||
<<: *collect-artifacts
|
<<: *collect-artifacts
|
||||||
<<: *docker-env
|
<<: *docker-env
|
||||||
<<: *compiler-info
|
<<: *compiler-info
|
||||||
@@ -195,14 +178,31 @@ build-linux-release:
|
|||||||
variables:
|
variables:
|
||||||
EXTRA_FLAGS: "--features=real-overseer"
|
EXTRA_FLAGS: "--features=real-overseer"
|
||||||
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
|
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
|
||||||
when: manual
|
variables:
|
||||||
allow_failure: true
|
EXTRA_FLAGS: "--features=real-overseer"
|
||||||
- when: always
|
- when: always
|
||||||
script:
|
script:
|
||||||
- time cargo build --release --verbose ${EXTRA_FLAGS}
|
- time cargo build --release --verbose ${EXTRA_FLAGS}
|
||||||
- sccache -s
|
- sccache -s
|
||||||
- *pack-artifacts
|
- *pack-artifacts
|
||||||
|
|
||||||
|
#### stage: build
|
||||||
|
|
||||||
|
check-transaction-versions:
|
||||||
|
image: node:15
|
||||||
|
stage: build
|
||||||
|
<<: *rules-test
|
||||||
|
<<: *docker-env
|
||||||
|
needs:
|
||||||
|
- job: test-linux-stable
|
||||||
|
artifacts: true
|
||||||
|
before_script:
|
||||||
|
- apt-get -y update; apt-get -y install jq lsof
|
||||||
|
- npm install --ignore-scripts -g @polkadot/metadata-cmp
|
||||||
|
- git fetch origin release
|
||||||
|
script:
|
||||||
|
- scripts/gitlab/check_extrinsics_ordering.sh
|
||||||
|
|
||||||
generate-impl-guide:
|
generate-impl-guide:
|
||||||
stage: build
|
stage: build
|
||||||
<<: *rules-test
|
<<: *rules-test
|
||||||
@@ -213,12 +213,15 @@ generate-impl-guide:
|
|||||||
script:
|
script:
|
||||||
- mdbook build roadmap/implementers-guide
|
- mdbook build roadmap/implementers-guide
|
||||||
|
|
||||||
#### stage: publish
|
|
||||||
|
|
||||||
.build-push-docker-image: &build-push-docker-image
|
.build-push-docker-image: &build-push-docker-image
|
||||||
<<: *kubernetes-env
|
<<: *kubernetes-env
|
||||||
<<: *collect-artifacts
|
|
||||||
image: quay.io/buildah/stable
|
image: quay.io/buildah/stable
|
||||||
|
variables:
|
||||||
|
GIT_STRATEGY: none
|
||||||
|
# DOCKERFILE: scripts/docker/Dockerfile
|
||||||
|
IMAGE_NAME: docker.io/parity/polkadot
|
||||||
|
DOCKER_USER: ${Docker_Hub_User_Parity}
|
||||||
|
DOCKER_PASS: ${Docker_Hub_Pass_Parity}
|
||||||
before_script: &check-versions
|
before_script: &check-versions
|
||||||
- test -s ./artifacts/VERSION || exit 1
|
- test -s ./artifacts/VERSION || exit 1
|
||||||
- test -s ./artifacts/EXTRATAG || exit 1
|
- test -s ./artifacts/EXTRATAG || exit 1
|
||||||
@@ -226,7 +229,7 @@ generate-impl-guide:
|
|||||||
- EXTRATAG="$(cat ./artifacts/EXTRATAG)"
|
- EXTRATAG="$(cat ./artifacts/EXTRATAG)"
|
||||||
- echo "Polkadot version = ${VERSION} (EXTRATAG ${EXTRATAG})"
|
- echo "Polkadot version = ${VERSION} (EXTRATAG ${EXTRATAG})"
|
||||||
script:
|
script:
|
||||||
- test "$Docker_Hub_User_Parity" -a "$Docker_Hub_Pass_Parity" ||
|
- test "$DOCKER_USER" -a "$DOCKER_PASS" ||
|
||||||
( echo "no docker credentials provided"; exit 1 )
|
( echo "no docker credentials provided"; exit 1 )
|
||||||
- cd ./artifacts
|
- cd ./artifacts
|
||||||
- buildah bud
|
- buildah bud
|
||||||
@@ -236,23 +239,27 @@ generate-impl-guide:
|
|||||||
--tag "$IMAGE_NAME:$VERSION"
|
--tag "$IMAGE_NAME:$VERSION"
|
||||||
--tag "$IMAGE_NAME:$EXTRATAG" .
|
--tag "$IMAGE_NAME:$EXTRATAG" .
|
||||||
# The job will success only on the protected branch
|
# The job will success only on the protected branch
|
||||||
- echo "$Docker_Hub_Pass_Parity" |
|
- echo "$DOCKER_PASS" |
|
||||||
buildah login --username "$Docker_Hub_User_Parity" --password-stdin docker.io
|
buildah login --username "$DOCKER_USER" --password-stdin docker.io
|
||||||
- buildah info
|
- buildah info
|
||||||
- buildah push --format=v2s2 "$IMAGE_NAME:$VERSION"
|
- buildah push --format=v2s2 "$IMAGE_NAME:$VERSION"
|
||||||
- buildah push --format=v2s2 "$IMAGE_NAME:$EXTRATAG"
|
- buildah push --format=v2s2 "$IMAGE_NAME:$EXTRATAG"
|
||||||
|
# pass artifacts to the trigget-simnet job
|
||||||
|
# this twist is to match the similar logic in substrate
|
||||||
|
- echo "VERSION=${EXTRATAG}" > build.env
|
||||||
|
- echo "TRIGGERER=${CI_PROJECT_NAME}" >> build.env
|
||||||
after_script:
|
after_script:
|
||||||
- buildah logout "$IMAGE_NAME"
|
- buildah logout "$IMAGE_NAME"
|
||||||
# only VERSION information is needed for the deployment
|
artifacts:
|
||||||
- find ./artifacts/ -depth -not -name VERSION -not -name artifacts -delete
|
reports:
|
||||||
|
# this artifact is used in trigger-simnet job
|
||||||
|
# https://docs.gitlab.com/ee/ci/multi_project_pipelines.html#with-variable-inheritance
|
||||||
|
dotenv: build.env
|
||||||
|
|
||||||
|
|
||||||
publish-dockerhub:
|
publish-dockerhub:
|
||||||
stage: publish
|
stage: build
|
||||||
<<: *build-push-docker-image
|
<<: *build-push-docker-image
|
||||||
variables:
|
|
||||||
GIT_STRATEGY: none
|
|
||||||
# DOCKERFILE: scripts/docker/Dockerfile
|
|
||||||
IMAGE_NAME: docker.io/parity/polkadot
|
|
||||||
rules:
|
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
|
||||||
@@ -261,6 +268,12 @@ publish-dockerhub:
|
|||||||
- if: $CI_COMMIT_REF_NAME == "rococo-v1"
|
- if: $CI_COMMIT_REF_NAME == "rococo-v1"
|
||||||
variables:
|
variables:
|
||||||
IMAGE_NAME: docker.io/parity/rococo
|
IMAGE_NAME: docker.io/parity/rococo
|
||||||
|
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
|
||||||
|
variables:
|
||||||
|
# image to be tested with Simnet
|
||||||
|
IMAGE_NAME: docker.io/paritypr/synth-wave
|
||||||
|
DOCKER_USER: ${PARITYPR_USER}
|
||||||
|
DOCKER_PASS: ${PARITYPR_PASS}
|
||||||
- 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"
|
||||||
@@ -268,6 +281,8 @@ publish-dockerhub:
|
|||||||
- job: build-linux-release
|
- job: build-linux-release
|
||||||
artifacts: true
|
artifacts: true
|
||||||
|
|
||||||
|
#### stage: publish
|
||||||
|
|
||||||
publish-s3-release:
|
publish-s3-release:
|
||||||
stage: publish
|
stage: publish
|
||||||
needs:
|
needs:
|
||||||
@@ -329,3 +344,16 @@ deploy-polkasync-kusama:
|
|||||||
POLKADOT_CI_COMMIT_REF: "${CI_COMMIT_REF}"
|
POLKADOT_CI_COMMIT_REF: "${CI_COMMIT_REF}"
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
trigger: "parity/infrastructure/parity-testnet"
|
trigger: "parity/infrastructure/parity-testnet"
|
||||||
|
|
||||||
|
trigger-simnet:
|
||||||
|
stage: deploy
|
||||||
|
<<: *rules-test
|
||||||
|
needs:
|
||||||
|
- job: publish-dockerhub
|
||||||
|
# build.env is passed with an exact VERSION (EXTRATAG here, i.e. 2643-0.8.29-5f689e0a-6b24dc54)
|
||||||
|
# Simnet uses an image published on PRs with this exact version for triggered runs on commits.
|
||||||
|
# And parity/rococo:rococo-v1 for runs not launched by this job.
|
||||||
|
trigger:
|
||||||
|
project: parity/simnet
|
||||||
|
branch: master
|
||||||
|
strategy: depend
|
||||||
|
|||||||
Reference in New Issue
Block a user