diff --git a/jenkins/jobs/infra.yaml b/jenkins/jobs/infra.yaml index 0e6a3bf450..0cca63f19f 100644 --- a/jenkins/jobs/infra.yaml +++ b/jenkins/jobs/infra.yaml @@ -447,9 +447,9 @@ node: ubuntu-xenial builders: - - zuul-clone: + - zuul-clone-workspace: project: openstack-infra/zuul - - shell: openstack-infra/zuul/tools/nodepool-integration-setup.sh + - shell: tools/nodepool-integration-setup.sh - run-tox: envlist: 'nodepool' diff --git a/jenkins/jobs/macros.yaml b/jenkins/jobs/macros.yaml index 550fa15cc7..82d4eee651 100644 --- a/jenkins/jobs/macros.yaml +++ b/jenkins/jobs/macros.yaml @@ -321,6 +321,33 @@ /usr/zuul-env/bin/zuul-cloner --cache-dir /opt/git \ git://git.openstack.org {project} +- builder: + name: zuul-clone-workspace + builders: + - shell: | + #!/bin/bash -xe + CLONEMAP=`mktemp` + function cleanup {{ + # In cases where zuul-cloner is aborted during a git + # clone operation, git will remove the git work tree in + # its cleanup. The work tree in these jobs is the + # workspace directory, which means that subsequent + # jenkins post-build actions can not run because the + # workspace has been removed. + # To reduce the likelyhood of this having an impact, + # recreate the workspace directory if needed + mkdir -p $WORKSPACE + rm -f $CLONEMAP + }} + trap cleanup EXIT + cat > $CLONEMAP << EOF + clonemap: + - name: {project} + dest: . + EOF + /usr/zuul-env/bin/zuul-cloner -m $CLONEMAP --cache-dir /opt/git \ + git://git.openstack.org {project} + - builder: name: revoke-sudo builders: