Commit f69e79f4 authored by Benjamin Tissoires's avatar Benjamin Tissoires
Browse files

CI: add a job to allow to continue the pipeline



If a distribution pipeline fails, the parent trigger job will be updated,
but the pipeline will not continue. It's a gitlab upstream issue, but
until it is fixed, add a workaround for it:
- we add a new stage right after the children pipelines which will be
  always run
- the jobs reflects the status of the total children pipelines
- when the downstream piplines are fixed, we can manually retrigger this
  job, and continue the pipeline
Signed-off-by: Benjamin Tissoires's avatarBenjamin Tissoires <benjamin.tissoires@gmail.com>
parent 16f790f9
Pipeline #234146 passed with stages
in 1 minute and 53 seconds
......@@ -2,6 +2,7 @@ stages:
- sanity check
- bootstrapping
- distributions
- post children pipelines
- ci-fairy
- deploy
- publish
......@@ -121,6 +122,29 @@ ubuntu:
strategy: depend
#
# this is a dummy job that checks for the results of
# the children pipelines we just triggered
# when we fixed one of them by retrying the failed jobs,
# the rest of the pipeline is not retriggered.
# With this job, we can retry it and continue
# the pipeline.
#
check children pipelines:
stage: post children pipelines
image: alpine:latest
before_script:
- apk update
- apk add jq curl
script:
- URL=https://gitlab.freedesktop.org/api/v4/projects/$CI_PROJECT_ID/pipelines/$CI_PIPELINE_ID/bridges
- DATA=$(curl $URL)
- echo $DATA | jq
- CHILD_STATUSES=$(echo $DATA | jq -r '.[] | .downstream_pipeline.status' | sort -u | grep -v null)
- echo $CHILD_STATUSES
- '[ "$CHILD_STATUSES" == "success" ]'
when: always
ci-fairy images:
stage: ci-fairy
trigger:
......
......@@ -2,6 +2,7 @@ stages:
- sanity check
- bootstrapping
- distributions
- post children pipelines
- ci-fairy
- deploy
- publish
......@@ -88,6 +89,29 @@ bootstrapping:
{% endfor %}
#
# this is a dummy job that checks for the results of
# the children pipelines we just triggered
# when we fixed one of them by retrying the failed jobs,
# the rest of the pipeline is not retriggered.
# With this job, we can retry it and continue
# the pipeline.
#
check children pipelines:
stage: post children pipelines
image: alpine:latest
before_script:
- apk update
- apk add jq curl
script:
- URL=https://gitlab.freedesktop.org/api/v4/projects/$CI_PROJECT_ID/pipelines/$CI_PIPELINE_ID/bridges
- DATA=$(curl $URL)
- echo $DATA | jq
- CHILD_STATUSES=$(echo $DATA | jq -r '.[] | .downstream_pipeline.status' | sort -u | grep -v null)
- echo $CHILD_STATUSES
- '[ "$CHILD_STATUSES" == "success" ]'
when: always
ci-fairy images:
stage: ci-fairy
trigger:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment