If running git clean after reset then retry

* modules/jenkins/files/slave_scripts/gerrit-git-prep.sh
* .../openstack_project/files/jenkins_job_builder/config/macros.yaml
* .../infra-publications.yaml: If a git clean can not remove some
files, for example because a previous command has not freed its open
file handles, it will return nonzero. If this happens, wait a moment
and try again in case this is only a briefly transient problem.

Change-Id: If11320da7379c8fb8841b945067ce544188f5681
This commit is contained in:
Jeremy Stanley 2013-11-27 01:05:17 +00:00
parent a28df0e75a
commit a86367a84d
3 changed files with 24 additions and 6 deletions

View File

@ -52,16 +52,25 @@ then
fi fi
git reset --hard git reset --hard
git clean -x -f -d -q if ! git clean -x -f -d -q ; then
sleep 1
git clean -x -f -d -q
fi
if [ -z "$ZUUL_NEWREV" ] if [ -z "$ZUUL_NEWREV" ]
then then
git fetch $ZUUL_SITE/p/$ZUUL_PROJECT $ZUUL_REF git fetch $ZUUL_SITE/p/$ZUUL_PROJECT $ZUUL_REF
git checkout FETCH_HEAD git checkout FETCH_HEAD
git reset --hard FETCH_HEAD git reset --hard FETCH_HEAD
git clean -x -f -d -q if ! git clean -x -f -d -q ; then
sleep 1
git clean -x -f -d -q
fi
else else
git checkout $ZUUL_NEWREV git checkout $ZUUL_NEWREV
git reset --hard $ZUUL_NEWREV git reset --hard $ZUUL_NEWREV
git clean -x -f -d -q if ! git clean -x -f -d -q ; then
sleep 1
git clean -x -f -d -q
fi
fi fi

View File

@ -26,7 +26,10 @@
- shell: | - shell: |
#!/bin/bash -xe #!/bin/bash -xe
git reset --hard remotes/origin/master git reset --hard remotes/origin/master
git clean -x -f -d -q if ! git clean -x -f -d -q ; then
sleep 1
git clean -x -f -d -q
fi
./make-index ./make-index
publishers: publishers:

View File

@ -188,10 +188,16 @@
git remote set-url origin https://review.openstack.org/p/openstack-infra/devstack-gate git remote set-url origin https://review.openstack.org/p/openstack-infra/devstack-gate
git remote update git remote update
git reset --hard git reset --hard
git clean -x -f if ! git clean -x -f ; then
sleep 1
git clean -x -f
fi
git checkout master git checkout master
git reset --hard remotes/origin/master git reset --hard remotes/origin/master
git clean -x -f if ! git clean -x -f ; then
sleep 1
git clean -x -f
fi
cd .. cd ..
fi fi