From 8ba51be8325c23e7cd62c802f79ef0d112fed983 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Thu, 24 Aug 2017 13:59:01 -0700 Subject: [PATCH] Support Zuul v3 repo layout To support a version of the devstack-gate job where we attempt to make the mininum changes necessary to run in Zuul v3, use the repos supplied by Zuul rather than running setup_project. Change-Id: If5feaaeabaa7a372facbee18eac91b74ac3944eb --- functions.sh | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/functions.sh b/functions.sh index ae3ad2f7..f9ae4cd5 100644 --- a/functions.sh +++ b/functions.sh @@ -501,17 +501,31 @@ function setup_workspace { sudo mkdir -p $DEST sudo chown -R $USER:$USER $DEST - # The vm template update job should cache the git repos - # Move them to where we expect: echo "Using branch: $base_branch" - for PROJECT in $PROJECTS; do - cd $DEST - if [ -d /opt/git/$PROJECT ]; then - # Start with a cached git repo if possible - rsync -a /opt/git/${PROJECT}/ `basename $PROJECT` - fi - setup_project $PROJECT $base_branch - done + if [ -d ~/src ]; then + # This is Zuul v3. + for PROJECT in $PROJECTS; do + cd $DEST + rsync -a ~/src/*/${PROJECT}/ `basename $PROJECT` + cd `basename $PROJECT` + if git_has_branch ${PROJECT} $base_branch; then + git_checkout ${PROJECT} $base_branch + else + git_checkout ${PROJECT} master + fi + done + else + # The vm template update job should cache the git repos + # Move them to where we expect: + for PROJECT in $PROJECTS; do + cd $DEST + if [ -d /opt/git/$PROJECT ]; then + # Start with a cached git repo if possible + rsync -a /opt/git/${PROJECT}/ `basename $PROJECT` + fi + setup_project $PROJECT $base_branch + done + fi # It's important we are back at DEST for the rest of the script cd $DEST