From 6be5eb6fb873efdd10e6e4690ecfcd443541bf19 Mon Sep 17 00:00:00 2001 From: Jan-Simon Moeller Date: Fri, 14 Feb 2020 11:30:15 +0100 Subject: 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 --- jjb/common/include-agl-header.sh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'jjb/common/include-agl-header.sh') 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" -- cgit 1.2.3-korg