diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2013-12-13 22:21:22 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2013-12-13 22:21:22 +0100 |
commit | aa9bfbf74e03c3499fa0e4ded749176f0de97a95 (patch) | |
tree | 71487cb5a1bbeb70f31542922aa5167315957121 | |
parent | 40754ccd94cd436b44343aeea25daa49b1c3809d (diff) | |
download | buildscripts-aa9bfbf74e03c3499fa0e4ded749176f0de97a95.tar.gz buildscripts-aa9bfbf74e03c3499fa0e4ded749176f0de97a95.tar.bz2 buildscripts-aa9bfbf74e03c3499fa0e4ded749176f0de97a95.zip |
auto-delay forced builds, as if several builds are triggered at once, this is likely to fail (repoquery locks, dpkg-source on changing Git files)
-rwxr-xr-x | bin/build-deb-package | 7 | ||||
-rwxr-xr-x | bin/build-rpm-package | 8 |
2 files changed, 15 insertions, 0 deletions
diff --git a/bin/build-deb-package b/bin/build-deb-package index 49c0d80..9cc8bae 100755 --- a/bin/build-deb-package +++ b/bin/build-deb-package @@ -333,10 +333,17 @@ unlock_workspace() { rm -f $LOCK_FILE } +delay_build() { + sleep $[ ( $RANDOM % 30 ) + 1 ]s +} + ### MAIN ### set_vars $@ && { if [ "x$(basename $0)" = "x$PREFIX-build-deb-package" ] || [ "x$(basename $0)" = "x$PREFIX-build+upload-deb-package" ]; then cd $PROJECT_DIR && pkgneedsbuild $CHECKOUT || [ "$FORCE_BUILD" = "yes" ] && { + if [ "x$FORCE_BUILD" = "xyes" ]; then + delay_build + fi lock_workspace prepare_workspace && { unlock_workspace diff --git a/bin/build-rpm-package b/bin/build-rpm-package index 03b31c5..01d107b 100755 --- a/bin/build-rpm-package +++ b/bin/build-rpm-package @@ -312,10 +312,18 @@ unlock_workspace() { rm -f $LOCK_FILE } +delay_build() { + sleep $[ ( ( $RANDOM % 10 ) + 1 ) * 10 ]s +} + + ### MAIN ### set_vars $@ && { if [ "x$(basename $0)" = "x$PREFIX-build-rpm-package" ] || [ "x$(basename $0)" = "x$PREFIX-build+upload-rpm-package" ]; then cd $PROJECT_DIR && pkgneedsbuild $CHECKOUT || [ "$FORCE_BUILD" = "yes" ] && { + if [ "x$FORCE_BUILD" = "xyes" ]; then + delay_build + fi lock_workspace prepare_workspace && { unlock_workspace |