summaryrefslogtreecommitdiffstats
path: root/src/ci/scripts/should-skip-this.sh
blob: 48127166ad0809b644ba4b533b042588ab0eec7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
# Set the SKIP_JOB environment variable if this job is not supposed to run on the current builder.

set -euo pipefail
IFS=$'\n\t'

source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"

if [[ -n "${CI_ONLY_WHEN_CHANNEL-}" ]]; then
    if [[ "${CI_ONLY_WHEN_CHANNEL}" = "$(cat src/ci/channel)" ]]; then
        echo "The channel is the expected one"
    else
        echo "Not executing this job as the channel is not the expected one"
        ciCommandSetEnv SKIP_JOB 1
        exit 0
    fi
fi


echo "Executing the job since there is no skip rule preventing the execution"
exit 0