From 2fd1e2bcf8ffee502dcbfc7f2f9e4ba705b72466 Mon Sep 17 00:00:00 2001 From: Christophe Lyon Date: Mon, 25 Mar 2019 09:42:13 +0000 Subject: docker-run.sh, jenkins-helpers.sh: Fix use of flock flock expects a real command as argument, not a shell function, so the scripts are currently broken: flock: failed to execute container_exec: No such file or directory This patch defines the JENKINS_FLOCK helper variable which is expanded by the remote_exec() shell helper. Change-Id: Ie5117d1116c9bbc9b556bc25946a7a0afc706ea2 --- jenkins-helpers.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'jenkins-helpers.sh') diff --git a/jenkins-helpers.sh b/jenkins-helpers.sh index 65428d9a..6119bab5 100644 --- a/jenkins-helpers.sh +++ b/jenkins-helpers.sh @@ -270,7 +270,8 @@ remote_exec () # Be careful to prepend statements before ${cmd[@]} only if necessary. # E.g., when triggering jobs via jenkins-cli, the command is not a binary, # so we can't "exec" it. - ssh $opts ${port:+-p$port} $host "${env_vars:+export $env_vars && }${dir:+cd "$(printf '%q' "$dir")" && exec }${cmd[@]}" + # We use flock if $JENKINS_FLOCK is set. + ${JENKINS_FLOCK+$JENKINS_FLOCK} ssh $opts ${port:+-p$port} $host "${env_vars:+export $env_vars && }${dir:+cd "$(printf '%q' "$dir")" && exec }${cmd[@]}" ) } -- cgit v1.2.3