From 67ea589dd47f8ce008032774fa1858c8a417e80b Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Mon, 29 Jun 2015 23:32:27 +0000 Subject: [PATCH] Add a zuul-git-prep builder macro Introducing zuul-git-prep, a lightweight replacement for the gerrit-git-prep builder macro using zuul-cloner to do the heavy lifting. This is based on the devstack-cloner macro which works similarly for bootstrapping devstack-gate based jobs. Change-Id: I536d53949df2b32ef0198629c584adbae14568a7 --- jenkins/jobs/macros.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/jenkins/jobs/macros.yaml b/jenkins/jobs/macros.yaml index 5f1616c44d..a0cf3aab32 100644 --- a/jenkins/jobs/macros.yaml +++ b/jenkins/jobs/macros.yaml @@ -21,6 +21,27 @@ sleep 5 done +- builder: + name: zuul-git-prep + builders: + - shell: | + #!/bin/bash -xe + cat > clonemap.yaml << EOF + clonemap: + - name: $ZUUL_PROJECT + dest: . + EOF + # If this is called in a periodic job, these will not be set + export ZUUL_BRANCH=${{ZUUL_BRANCH:-master}} + export ZUUL_REF=${{ZUUL_REF:-None}} + export BRANCH_OVERRIDE={branch-override} + if [ "$BRANCH_OVERRIDE" != "default" ] ; then + export ZUUL_BRANCH=$BRANCH_OVERRIDE + fi + /usr/zuul-env/bin/zuul-cloner -m clonemap.yaml --cache-dir /opt/git \ + git://git.openstack.org \ + $ZUUL_PROJECT + - builder: name: branch-git-prep builders: