diff --git a/modules/jenkins/files/slave_scripts/gerrit-git-prep.sh b/modules/jenkins/files/slave_scripts/gerrit-git-prep.sh index 623468c1c8..a550093473 100755 --- a/modules/jenkins/files/slave_scripts/gerrit-git-prep.sh +++ b/modules/jenkins/files/slave_scripts/gerrit-git-prep.sh @@ -2,6 +2,7 @@ GERRIT_SITE=$1 ZUUL_SITE=$2 +GIT_ORIGIN=$3 if [ -z "$GERRIT_SITE" ] then @@ -15,6 +16,13 @@ then exit 1 fi +if [ -z "$GIT_ORIGIN" ] +then + GIT_ORIGIN="$GERRIT_SITE/p" + # git://git.openstack.org/ + # https://review.openstack.org/p +fi + if [ -z "$ZUUL_REF" ] then echo "This job may only be triggered by Zuul." @@ -31,9 +39,9 @@ if [[ ! -e .git ]] then ls -a rm -fr .[^.]* * - git clone $GERRIT_SITE/p/$ZUUL_PROJECT . + git clone $GIT_ORIGIN/$ZUUL_PROJECT . fi -git remote set-url origin $GERRIT_SITE/p/$ZUUL_PROJECT +git remote set-url origin $GIT_ORIGIN/$ZUUL_PROJECT git remote update || git remote update # attempt to work around bug #925790 git reset --hard git clean -x -f -d -q diff --git a/modules/openstack_project/files/jenkins_job_builder/config/macros.yaml b/modules/openstack_project/files/jenkins_job_builder/config/macros.yaml index 0bceaa84a7..ead97ce1af 100644 --- a/modules/openstack_project/files/jenkins_job_builder/config/macros.yaml +++ b/modules/openstack_project/files/jenkins_job_builder/config/macros.yaml @@ -1,7 +1,7 @@ - builder: name: gerrit-git-prep builders: - - shell: "/usr/local/jenkins/slave_scripts/gerrit-git-prep.sh https://review.openstack.org http://zuul.openstack.org" + - shell: "/usr/local/jenkins/slave_scripts/gerrit-git-prep.sh https://review.openstack.org http://zuul.openstack.org git://git.openstack.org" - builder: name: coverage