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

CI: fix simnet trigger #8927

Merged
merged 2 commits into from
May 27, 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
27 changes: 15 additions & 12 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,16 @@ default:
paths:
- artifacts/

.kubernetes-build: &kubernetes-build
.kubernetes-env: &kubernetes-env
tags:
- kubernetes-parity-build
interruptible: true

.rust-info-script: &rust-info-script
- rustup show
- cargo --version
- rustup +nightly show
- cargo +nightly --version
- sccache -s

.docker-env: &docker-env
Expand Down Expand Up @@ -140,7 +142,7 @@ default:

skip-if-draft:
image: paritytech/tools:latest
<<: *kubernetes-build
<<: *kubernetes-env
stage: .pre
rules:
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
Expand All @@ -155,7 +157,7 @@ skip-if-draft:
check-runtime:
stage: check
image: paritytech/tools:latest
<<: *kubernetes-build
<<: *kubernetes-env
rules:
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
variables:
Expand All @@ -169,7 +171,7 @@ check-runtime:
check-signed-tag:
stage: check
image: paritytech/tools:latest
<<: *kubernetes-build
<<: *kubernetes-env
rules:
- if: $CI_COMMIT_REF_NAME =~ /^ci-release-.*$/
- if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
Expand All @@ -179,7 +181,7 @@ check-signed-tag:
check-line-width:
stage: check
image: paritytech/tools:latest
<<: *kubernetes-build
<<: *kubernetes-env
rules:
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
script:
Expand All @@ -189,7 +191,7 @@ check-line-width:
test-dependency-rules:
stage: check
image: paritytech/tools:latest
<<: *kubernetes-build
<<: *kubernetes-env
rules:
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
script:
Expand All @@ -198,7 +200,7 @@ test-dependency-rules:
test-prometheus-alerting-rules:
stage: check
image: paritytech/tools:latest
<<: *kubernetes-build
<<: *kubernetes-env
rules:
- if: $CI_PIPELINE_SOURCE == "pipeline"
when: never
Expand Down Expand Up @@ -419,7 +421,7 @@ cargo-check-macos:
check-polkadot-companion-status:
stage: build
image: paritytech/tools:latest
<<: *kubernetes-build
<<: *kubernetes-env
rules:
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
script:
Expand Down Expand Up @@ -536,7 +538,7 @@ build-rust-doc:

.build-push-docker-image: &build-push-docker-image
<<: *build-refs
<<: *kubernetes-build
<<: *kubernetes-env
image: quay.io/buildah/stable
variables: &docker-build-vars
<<: *default-vars
Expand Down Expand Up @@ -598,7 +600,7 @@ publish-docker-subkey:
publish-s3-release:
stage: publish
<<: *build-refs
<<: *kubernetes-build
<<: *kubernetes-env
needs:
- job: build-linux-substrate
artifacts: true
Expand Down Expand Up @@ -627,7 +629,7 @@ publish-s3-doc:
- job: build-linux-substrate
artifacts: false
<<: *build-refs
<<: *kubernetes-build
<<: *kubernetes-env
variables:
GIT_STRATEGY: none
BUCKET: "releases.parity.io"
Expand Down Expand Up @@ -689,6 +691,7 @@ deploy-prometheus-alerting-rules:
trigger-simnet:
stage: deploy
image: paritytech/tools:latest
<<: *kubernetes-env
rules:
- if: $CI_PIPELINE_SOURCE == "pipeline"
when: never
Expand All @@ -705,4 +708,4 @@ trigger-simnet:
DWNSTRM_ID: 332
script:
# API trigger for a simnet job
- ./scripts/gitlab/trigger_pipeline.sh
- .maintain/gitlab/trigger_pipeline.sh
7 changes: 4 additions & 3 deletions .maintain/gitlab/trigger_pipeline.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!/bin/bash

set -eu

# API trigger another project's pipeline
echo "Triggering Simnet pipeline."

curl --silent \
-X POST \
-F "token=${CI_JOB_TOKEN}" \
-F "ref=master" \
-F "ref=v3" `# trigger the pinned version of simnet CI config` \
-F "variables[TRGR_PROJECT]=${TRGR_PROJECT}" \
-F "variables[TRGR_REF]=${TRGR_REF}" \
-F "variables[IMAGE_NAME]=${IMAGE_NAME}" \
Expand Down Expand Up @@ -38,9 +39,9 @@ for i in $(seq 1 360); do
STATUS=$(get_status);
echo "Triggered pipeline status is ${STATUS}";
if [[ ${STATUS} =~ ^(pending|running|created)$ ]]; then
echo "${STATUS}"...";
echo;
elif [[ ${STATUS} =~ ^(failed|canceled|skipped|manual)$ ]]; then
echo "Oh noes! Something's broken in: ${PIPELINE_URL}"; exit 1;
echo "Something's broken in: ${PIPELINE_URL}"; exit 1;
elif [[ ${STATUS} =~ ^(success)$ ]]; then
echo "Look how green it is: ${PIPELINE_URL}"; exit 0;
else
Expand Down