From 2f64edb7fa0d9f584f168f4d3532d5bf4d0fcdd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 27 Jul 2020 19:47:03 +0200 Subject: turris: run only one job type instance --- templates/turris.run | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/templates/turris.run b/templates/turris.run index 9c2bc0c..0752be4 100755 --- a/templates/turris.run +++ b/templates/turris.run @@ -7,7 +7,12 @@ num_jobs="$(($(nproc) * 2))" make="force-make -j$num_jobs -d$num_jobs -f V=99 -- -l$(nproc) BUILD_LOG=1" ################################################### export IS_TTY=1 -# TODO take lock so we won't run multiple instances of new builds + +# Lock for execution +if [ "$1" != "--locked" ]; then + exec flock --exclusive "$WORKSPACE/execution.lock" "$0" --locked "$@" +fi +shift # Shift --locked curl "https://repo.turris.cz/$ANIMAL/$BOARD/packages/git-hash" > git-hash cat git-hash -- cgit v1.2.3