diff options
Diffstat (limited to 'round-robin.sh')
-rw-r--r-- | round-robin.sh | 46 |
1 files changed, 39 insertions, 7 deletions
diff --git a/round-robin.sh b/round-robin.sh index e4ff41a0..1fdd27de 100644 --- a/round-robin.sh +++ b/round-robin.sh @@ -7,6 +7,11 @@ #rr[PROJECT_url] # PROJECT's git branch or SHA1 revision parsable by git rev-parse. +# A special value "baseline" means that PROJECT is not being updated +# in this build, and its baseline branch should be used. +# In a successful build "update_baseline" step will update baseline +# branches of all PROJECTs to the current values, thus setting +# a baseline for the next build. #rr[PROJECT_branch] # PROJECT's git SHA1 revision. These are mostly used in manifests. @@ -16,13 +21,6 @@ # be present in all above git repos (if ${rr[init_configuration]} is false). #rr[baseline_branch]="${rr[ci_project]}/${rr[ci_config]}" -# PROJECT that we are testing in this build. Use ${rr[current_branch]} for -# this project, and ${rr[baseline_branch]} for all other projects. -#rr[current_project]="$current_project" - -# Git branch or SHA1 revision of ${rr[current_project]} to test. -#rr[current_branch]="$current_branch" - # Run mode: bisect or non-bisect. In bisect mode we do a couple things # slightly differently (e.g., don't touch repo in clone_repo() ). #rr[mode]="$mode" @@ -40,6 +38,40 @@ # to initialize baseline branches in git repos. #rr[init_configuration]=false +# Print round-robin components that are being updated in this build +# (the ones using non-baseline branches). +print_updated_components () +{ + ( + set -euf -o pipefail + + local delim="" + local c + for c in ${rr[components]}; do + if [ x"${rr[${c}_branch]}" != x"baseline" ]; then + printf "%s%s" "$delim" "$c" + delim=${1- } + fi + done + ) +} + +# Print the single round-robin component being updated in this build. +# Print nothing if multiple components are being updated. +print_single_updated_component () +{ + ( + set -euf -o pipefail + + local -a updated_components + updated_components=($(print_updated_components)) + + if [ ${#updated_components[@]} = 1 ]; then + echo "${updated_components[0]}" + fi + ) +} + # Reset artifacts to an empty state. ${rr[top_artifacts]}/results is the most # important artifact, since it records the metric of how successful the build # is. |