Commit 9600f754 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'fix-get-job-id-script-for-fail-fast' into 'master'

Fix script to fail pipeline early

See merge request gitlab-org/gitlab!42428
parents 21d4eb03 7d981a94
......@@ -110,7 +110,7 @@ function get_job_id() {
let "page++"
done
if [[ "${job_id}" == "" ]]; then
if [[ "${job_id}" == "null" ]]; then # jq prints "null" for non-existent attribute
echoerr "The '${job_name}' job ID couldn't be retrieved!"
else
echoinfo "The '${job_name}' job ID is ${job_id}"
......@@ -142,7 +142,7 @@ function fail_pipeline_early() {
local dont_interrupt_me_job_id
dont_interrupt_me_job_id=$(get_job_id 'dont-interrupt-me' 'scope=success')
if [[ "${dont_interrupt_me_job_id}" != "" ]]; then
if [[ -n "${dont_interrupt_me_job_id}" ]]; then
echoinfo "This pipeline cannot be interrupted due to \`dont-interrupt-me\` job ${dont_interrupt_me_job_id}"
else
echoinfo "Failing pipeline early for fast feedback due to test failures in rspec fail-fast."
......
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