From: Jo-Philipp Wich Date: Tue, 9 Jan 2018 14:33:04 +0000 (+0100) Subject: phase1: move cleanup.sh script out of build/ subdir X-Git-Tag: v1~161 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=14cd42c5b9448d63296cfa4bbb572c43b5d2b180;p=buildbot.git phase1: move cleanup.sh script out of build/ subdir When cleanup.sh itself is placed into the build/ subdir, subsequent Git() source steps will fail with a directory not empty error. Signed-off-by: Jo-Philipp Wich --- diff --git a/phase1/cleanup.sh b/phase1/cleanup.sh index f2d0bcc..4260958 100755 --- a/phase1/cleanup.sh +++ b/phase1/cleanup.sh @@ -60,7 +60,7 @@ if [ "$current_mode" = full ]; then exit 1 fi - for build_dir in ../../*; do + for build_dir in ../*; do build_dir="$(readlink -f "$build_dir")" @@ -86,14 +86,17 @@ if [ "$current_mode" = full ]; then ) done -) 200>../../cleanup.lock +) 200>../cleanup.lock # # Clean up current build # else - do_cleanup + if [ -d build ]; then ( + cd build + do_cleanup + ); fi fi exit 0 diff --git a/phase1/master.cfg b/phase1/master.cfg index 8f53f9d..94bbfad 100644 --- a/phase1/master.cfg +++ b/phase1/master.cfg @@ -404,7 +404,7 @@ for target in targets: # cleanup.sh if needed factory.addStep(FileDownload( mastersrc = "cleanup.sh", - slavedest = "cleanup.sh", + slavedest = "../cleanup.sh", mode = 0755, doStepIf = IsCleanupRequested)) @@ -412,6 +412,7 @@ for target in targets: name = "cleanold", description = "Cleaning previous builds", command = ["./cleanup.sh", c['buildbotURL'], WithProperties("%(slavename)s"), WithProperties("%(buildername)s"), "full"], + workdir = ".", haltOnFailure = True, doStepIf = IsCleanupRequested, timeout = 2400)) @@ -420,6 +421,7 @@ for target in targets: name = "cleanup", description = "Cleaning work area", command = ["./cleanup.sh", c['buildbotURL'], WithProperties("%(slavename)s"), WithProperties("%(buildername)s"), "single"], + workdir = ".", haltOnFailure = True, doStepIf = IsCleanupRequested, timeout = 2400))