summaryrefslogtreecommitdiff
path: root/round-robin.sh
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2018-12-14 11:56:52 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2018-12-18 12:15:36 +0000
commitbcaedfc5d0390e8af6c092b04e0dad59561beb38 (patch)
tree6bb408342ba24e86e1de3485312fdb12da3e36d3 /round-robin.sh
parentea235db8947d604be8c62c294a880495f2bce862 (diff)
tcwg_kernel-build.sh: Add new --mode reproduce
... to reproduce a previous build using manifest. Change-Id: I21521204a3d8b409c7dbf1c45137ddb8c6f85f15
Diffstat (limited to 'round-robin.sh')
-rw-r--r--round-robin.sh28
1 files changed, 18 insertions, 10 deletions
diff --git a/round-robin.sh b/round-robin.sh
index 278c9b07..e257b776 100644
--- a/round-robin.sh
+++ b/round-robin.sh
@@ -59,7 +59,11 @@ reset_artifacts ()
# steps.
# TODO: base-artifacts repo is starting to get big, so we should
# fetch only the $baseline branch, instead of all branches.
+ rr[base-artifacts_rev]="${rr[base-artifacts_rev]-${rr[baseline_branch]}}"
clone_or_update_repo base-artifacts ${rr[baseline_branch]} https://git-us.linaro.org/toolchain/ci/base-artifacts.git
+ cat <<EOF | manifest_out
+rr[base-artifacts_rev]=$(git_rev_parse_long base-artifacts HEAD)
+EOF
)
}
@@ -78,8 +82,8 @@ clone_repo ()
local branch
# Select the branch to build.
- # ${rr[current_rev]} specifies branch for ${rr[current_project]}, and everything else
- # uses baseline branch.
+ # ${rr[current_rev]} specifies branch for ${rr[current_project]},
+ # and everything else uses baseline branch.
if [ x"$project" = x"${rr[current_project]}" ]; then
if [ x"${rr[current_rev]}" = x"default" ]; then
branch=${rr[${current_project}_rev]}
@@ -88,6 +92,8 @@ clone_repo ()
else
branch=${rr[current_rev]}
fi
+ elif [ x"${rr[mode]}" = x"reproduce" ]; then
+ branch="${rr[${project}_rev]}"
else
branch="refs/remotes/baseline/${rr[baseline_branch]}"
fi
@@ -109,22 +115,24 @@ clone_repo ()
# Checkout, now that we have both origin and baseline remotes ready.
clone_or_update_repo $project $branch ${rr[${project}_url]} > /dev/null
- cd $project
+ local cur_rev
+ cur_rev=$(git_rev_parse_long $project HEAD)
- git rev-parse HEAD > $run_step_artifacts/revision
- if [ x"$project" = x"${rr[current_project]}" ]; then
- local baseline_rev bad_rev
+ cat <<EOF | manifest_out
+rr[${project}_rev]=$cur_rev
+EOF
- baseline_rev=$(git rev-parse refs/remotes/baseline/${rr[baseline_branch]})
- bad_rev=$(git rev-parse HEAD)
+ if [ x"$project" = x"${rr[current_project]}" ]; then
+ local baseline_rev
+ baseline_rev=$(git_rev_parse_long $project ${rr[baseline_branch]} baseline)
# Prepare for failure. If build fails we will bisect sha1 for
# ${rr[current_rev]} and sha1 for $baseline_rev.
cat > ${rr[top_artifacts]}/trigger-bisect-on-failure <<EOF
current_project=${rr[current_project]}
baseline_rev=$baseline_rev
-bad_rev=$bad_rev
+bad_rev=$cur_rev
EOF
- git rev-list --count HEAD ^$baseline_rev > ${rr[top_artifacts]}/distance-to-baseline
+ git -C $project rev-list --count HEAD ^$baseline_rev > ${rr[top_artifacts]}/distance-to-baseline
fi
)
}