summaryrefslogtreecommitdiff
path: root/tcwg_kernel-build.sh
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2018-11-07 14:58:23 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2018-11-08 10:39:08 +0000
commit7b99112cdb9f4cc761d3e51239da0a987c921435 (patch)
treedaa9622cfb20623a00bb60f62f9fccf0f1139d7a /tcwg_kernel-build.sh
parent0cb26e0b77d2f45ac4467096110607158a4e174d (diff)
tcwg_kernel-build: Fill reset_artifacts.
Change-Id: Icec96100e32fc5df26f1536c0102c1431d7c971c
Diffstat (limited to 'tcwg_kernel-build.sh')
-rwxr-xr-xtcwg_kernel-build.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/tcwg_kernel-build.sh b/tcwg_kernel-build.sh
index 7932d3d8..08e88736 100755
--- a/tcwg_kernel-build.sh
+++ b/tcwg_kernel-build.sh
@@ -99,8 +99,28 @@ fi
run_step_init "$start_at" "$finish_at" "$top_artifacts" "base-artifacts" "$verbose"
+# Reset artifacts to an empty state. $top_artifacts/results is the most
+# important artifact, since it records the metric of how successful the build
+# is.
reset_artifacts ()
{
+ (
+ set -euf -o pipefail
+
+ # We are called by run_step, which writes to console.log files,
+ # so remove everything but these files.
+ find $top_artifacts -maxdepth 1 ! -path $top_artifacts ! -path $top_artifacts/console.log ! -path $run_step_artifacts ! -path $run_step_artifacts/console.log -print0 | xargs -0 rm -rf
+
+ # Set success metric to worst possible (-3).
+ echo "Starting build" > $top_artifacts/results
+ echo "-3" >> $top_artifacts/results
+
+ # Clone base-artifacts so that run_step can rsync artifacts for skipped
+ # steps.
+ # TODO: base-artifacts repo is starting to get big, so we should
+ # fetch only the $baseline branch, instead of all branches.
+ clone_or_update_repo base-artifacts $baseline https://git-us.linaro.org/toolchain/ci/base-artifacts.git
+ )
}
clone_repo ()