summaryrefslogtreecommitdiff
path: root/tcwg_dummy-build.sh
blob: ccbc21852e236c66e505f1294ade400029304a3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash

set -euf -o pipefail

scripts=$(dirname $0)
# shellcheck source=jenkins-helpers.sh
. $scripts/jenkins-helpers.sh
# shellcheck source=round-robin.sh
. $scripts/round-robin.sh

convert_args_to_variables "$@"
obligatory_variables rr[ci_project] rr[ci_config] rr[components] bisect_log
declare -A rr
declare bisect_log

rr[mode]="${rr[mode]-build}"
rr[update_baseline]="${rr[update_baseline]-ignore}"
rr[baseline_branch]="linaro-local/ci/${rr[ci_project]}/${rr[ci_config]}"
rr[${rr[components]}_git]=${rr[${rr[components]}_git]-baseline}

# Set start and finish steps for different modes.
start_at=""
if [ x"${rr[mode]}" = x"bisect" ]; then
    start_at="clone_repo-${rr[components]}"
fi
run_step_init "$start_at" "" "${rr[top_artifacts]}" "true"

no_regression_p ()
{
    local rev
    rev=$(get_current_git "${rr[components]}_rev")
    if grep -q "^git bisect bad $rev" "$bisect_log"; then
	return 1
    fi
}

run_step stop_on_fail -10 reset_artifacts
run_step skip_on_fail 0 clone_repo "${rr[components]}"
run_step reset_on_fail x check_regression