diff --git a/functions b/functions index 876d726fa..49e923415 100644 --- a/functions +++ b/functions @@ -12,7 +12,7 @@ install_external() { PUPPETFILE=${SCRIPT_DIR}/Puppetfile1 r10k -v DEBUG puppetfile install } -# Install Puppet OpenStack modules with zuul-cloner +# Install Puppet OpenStack modules from zuul checkouts # Uses the following variables: # # - ``PUPPETFILE_DIR`` must be set to Puppet modules directory @@ -31,20 +31,20 @@ install_openstack() { fi fi - cat > clonemap.yaml < $CLONEMAP << EOF - clonemap: - - name: $ZUUL_PROJECT - dest: . - - name: openstack/puppet-openstack-integration - dest: openstack/puppet-openstack-integration - EOF - /usr/zuul-env/bin/zuul-cloner -m $CLONEMAP --cache-dir /opt/git \ - https://opendev.org $ZUUL_PROJECT openstack/puppet-openstack-integration + + if [ -d /home/zuul/src/opendev.org/$ZUUL_PROJECT ]; then + cp -dR /home/zuul/src/opendev.org/$ZUUL_PROJECT/. . + else + git clone https://opendev.org/$ZUUL_PROJECT . + fi + if [ -d /home/zuul/src/opendev.org/openstack/puppet-openstack-integration ]; then + [ ! -d puppet-openstack-integration ] && mkdir puppet-openstack-integration + cp -dR /home/zuul/src/opendev.org/openstack/puppet-openstack-integration/. puppet-openstack-integration + else + git clone https://opendev.org/openstack/puppet-openstack-integration puppet-openstack-integration + fi executable: /bin/bash chdir: '{{ ansible_user_dir }}/workspace' environment: '{{ zuul | zuul_legacy_vars }}' diff --git a/playbooks/prepare-node-integration.yaml b/playbooks/prepare-node-integration.yaml index d756db9c1..6ad292b29 100644 --- a/playbooks/prepare-node-integration.yaml +++ b/playbooks/prepare-node-integration.yaml @@ -12,20 +12,12 @@ if [[ "$ZUUL_BRANCH" == "stable/jewel" ]]; then ZUUL_BRANCH_REAL='stable/pike' fi - CLONEMAP=`mktemp` - function cleanup { - rm -f $CLONEMAP - } - trap cleanup EXIT - cat > $CLONEMAP << EOF - clonemap: - - name: openstack/puppet-openstack-integration - dest: puppet-openstack-integration - EOF - /usr/zuul-env/bin/zuul-cloner -m $CLONEMAP \ - --cache-dir /opt/git \ - --zuul-branch $ZUUL_BRANCH_REAL \ - https://opendev.org openstack/puppet-openstack-integration + if [ -d /home/zuul/src/opendev.org/openstack/puppet-openstack-integration ]; then + [ ! -d puppet-openstack-integration ] && mkdir puppet-openstack-integration + cp -dR /home/zuul/src/opendev.org/openstack/puppet-openstack-integration/. puppet-openstack-integration + else + git clone -b $ZUUL_BRANCH_REAL https://opendev.org/openstack/puppet-openstack-integration puppet-openstack-integration + fi executable: /bin/bash chdir: '{{ ansible_user_dir }}/workspace' environment: '{{ zuul | zuul_legacy_vars }}' diff --git a/playbooks/prepare-node-unit.yaml b/playbooks/prepare-node-unit.yaml index d6ba3e13a..77b449251 100644 --- a/playbooks/prepare-node-unit.yaml +++ b/playbooks/prepare-node-unit.yaml @@ -4,27 +4,11 @@ cmd: | set -e set -x - 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 likelihood 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: $ZUUL_PROJECT - dest: . - EOF - /usr/zuul-env/bin/zuul-cloner -m $CLONEMAP --cache-dir /opt/git \ - https://opendev.org $ZUUL_PROJECT + if [ -d /home/zuul/src/opendev.org/$ZUUL_PROJECT ]; then + cp -dR /home/zuul/src/opendev.org/$ZUUL_PROJECT/. . + else + git clone https://opendev.org/$ZUUL_PROJECT . + fi executable: /bin/bash chdir: '{{ ansible_user_dir }}/workspace' environment: '{{ zuul | zuul_legacy_vars }}' diff --git a/run_tests.sh b/run_tests.sh index 56a5bdb72..cbe2f5d22 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -105,16 +105,23 @@ if [[ "${ZUUL_PROJECT}" = "openstack/tempest" ]]; then TEMPEST_FROM_SOURCE=true fi - -if [ -e /usr/zuul-env/bin/zuul-cloner ] ; then +if [ -d /home/zuul/src/opendev.org ]; then # For ubuntu we always need to deploy tempest-horizon from source if uses_debs; then - /usr/zuul-env/bin/zuul-cloner --workspace /tmp --cache-dir /opt/git \ - https://git.openstack.org openstack/tempest-horizon + if [ -d /home/zuul/src/opendev.org/openstack/tempest-horizon ]; then + [ ! -d /tmp/openstack ] && mkdir -p /tmp/openstack + cp -R /home/zuul/src/opendev.org/openstack/tempest-horizon /tmp/openstack/tempest-horizon + else + git clone https://opendev.org/openstack/tempest-horizon /tmp/openstack/tempest-horizon + fi fi if [ "${TEMPEST_FROM_SOURCE}" = true ]; then - /usr/zuul-env/bin/zuul-cloner --workspace /tmp --cache-dir /opt/git \ - https://git.openstack.org openstack/tempest + if [ -d /home/zuul/src/opendev.org/openstack/tempest ]; then + [ ! -d /tmp/openstack ] && mkdir -p /tmp/openstack + cp -R /home/zuul/src/opendev.org/openstack/tempest /tmp/openstack/tempest + else + git clone https://opendev.org/openstack/tempest /tmp/openstack/tempest + fi # Pin Tempest to TEMPEST_VERSION unless we're running inside the # openstack/tempest gate. if [[ "${ZUUL_PROJECT}" != "openstack/tempest" ]]; then