From f0b932139ebd2da54fae73dfa68b6540b7a8775e Mon Sep 17 00:00:00 2001 From: Alexander Samusev <41779041+alvicsam@users.noreply.github.com> Date: Wed, 22 Jun 2022 09:40:52 +0200 Subject: [PATCH] Add publish docker staking-miner (#5710) * [DO NOT MERGE] Add publish docker staking-miner * debug docker publish * remove debug * small naming fix * fix comment --- polkadot/.gitlab-ci.yml | 47 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/polkadot/.gitlab-ci.yml b/polkadot/.gitlab-ci.yml index a48c00e92f..8042f279e6 100644 --- a/polkadot/.gitlab-ci.yml +++ b/polkadot/.gitlab-ci.yml @@ -106,13 +106,23 @@ default: - if: $CI_COMMIT_REF_NAME == "master" - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs -.publish-refs: &publish-refs +.deploy-testnet-refs: &deploy-testnet-refs rules: - if: $CI_PIPELINE_SOURCE == "pipeline" when: never - if: $CI_PIPELINE_SOURCE == "schedule" - if: $CI_COMMIT_REF_NAME == "master" +.publish-refs: &publish-refs + rules: + - if: $CI_PIPELINE_SOURCE == "pipeline" + when: never + - if: $CI_PIPELINE_SOURCE == "schedule" + - if: $CI_PIPELINE_SOURCE == "web" && + $CI_COMMIT_REF_NAME == "master" + - if: $CI_COMMIT_REF_NAME == "master" + - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 + .build-push-image: &build-push-image <<: *kubernetes-env image: quay.io/buildah/stable @@ -266,6 +276,22 @@ build-malus: - echo "polkadot-test-malus = $(cat ./artifacts/VERSION) (EXTRATAG = $(cat ./artifacts/EXTRATAG))" - cp -r ./scripts/* ./artifacts +build-staking-miner: + stage: stage1 + <<: *collect-artifacts + <<: *docker-env + <<: *compiler-info + <<: *common-refs + script: + - time cargo build --locked --release --package staking-miner + # pack artifacts + - mkdir -p ./artifacts + - mv ./target/release/staking-miner ./artifacts/. + - echo -n "${CI_COMMIT_REF_NAME}" > ./artifacts/VERSION + - echo -n "${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}" > ./artifacts/EXTRATAG + - echo "staking-miner = $(cat ./artifacts/VERSION) (EXTRATAG = $(cat ./artifacts/EXTRATAG))" + - cp -r ./scripts/* ./artifacts + #### stage: stage2 .check-dependent-project: &check-dependent-project @@ -424,6 +450,23 @@ publish-malus-image: # this artifact is used in zombienet-tests job dotenv: ./artifacts/malus.env +publish-staking-miner-image: + stage: stage2 + <<: *build-push-image + <<: *publish-refs + variables: + <<: *image-variables + # scripts/ci/dockerfiles/staking-miner/staking-miner_injected.Dockerfile + DOCKERFILE: ci/dockerfiles/staking-miner/staking-miner_injected.Dockerfile + IMAGE_NAME: docker.io/paritytech/staking-miner + GIT_STRATEGY: none + DOCKER_USER: ${Docker_Hub_User_Parity} + DOCKER_PASS: ${Docker_Hub_Pass_Parity} + needs: + - job: build-staking-miner + artifacts: true + + publish-s3-release: &publish-s3 stage: stage3 needs: @@ -586,7 +629,7 @@ deploy-parity-testnet: needs: - job: test-deterministic-wasm artifacts: false - <<: *publish-refs + <<: *deploy-testnet-refs variables: POLKADOT_CI_COMMIT_NAME: "${CI_COMMIT_REF_NAME}" POLKADOT_CI_COMMIT_REF: "${CI_COMMIT_SHORT_SHA}"