From: Jan-Simon Moeller Date: Fri, 14 Feb 2020 10:30:15 +0000 (+0100) Subject: Avoid race condition on .gitconfig.lock X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F52%2F23952%2F1;p=ci-management.git Avoid race condition on .gitconfig.lock on parallel builds on the same host. This avoids: error: could not lock config file /home/jenkins/.gitconfig: File exists Signed-off-by: Jan-Simon Moeller Change-Id: Ib3f0b3cec91d87f0170c92c6781df67e2e7c75af --- diff --git a/jjb/common/include-agl-header.sh b/jjb/common/include-agl-header.sh index 2dbf9269..6e118837 100644 --- a/jjb/common/include-agl-header.sh +++ b/jjb/common/include-agl-header.sh @@ -165,6 +165,9 @@ set | grep ^GERRIT || true set | grep ^MACHINE || true #fi +# to avoid .gitconfig.lock race condition do +sleep $((1 + RANDOM % 10)) + if test ! -f ~/.gitconfig ; then git config --global user.email "jenkins-dontreply@build.automotivelinux.org" git config --global user.name "jenkins-dontreply@build.automotivelinux.org"