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

Add publish docker staking-miner #5710

Merged
merged 5 commits into from
Jun 22, 2022
Merged
Changes from 4 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
45 changes: 44 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,22 @@ default:
- if: $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs

.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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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/malus_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:
Expand Down Expand Up @@ -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}"
Expand Down