Allow to configure git base URL

Makes the devstack-gate usable with a generic git repo.

git.openstack.org is hard-coded in functions.sh. Make it
configurable via GIT_BASE. Set defaults in functions.sh
just in case there is a consumer of functions.sh other than
devstack-gate-gate-wrap.sh.

Define GIT_BASE in devstack-vm-gate-wrap.sh which
defaults to git.openstack.org, so that it can be set
via JJB changes only (layout.yaml).

The name of the "trunk" branch where devstack-gate is
fecthed from, and where grenade gets the latest code from,
is hard-coded to "master.

Define GIT_BRANCH in devstack-vm-gate-wrap.sh which
defaults to master.

Change-Id: I59c1c63d6e8ac8482821728bf03bfce69898e919
This commit is contained in:
andrea-frittoli 2014-05-27 21:24:51 +01:00 committed by Andrea Frittoli
parent 5cab8f4057
commit 537a292674
2 changed files with 10 additions and 5 deletions

View File

@ -22,6 +22,9 @@
# Most of the work of this script is done in functions so that we may
# easily redirect their stdout / stderr to log files.
GIT_BASE=${GIT_BASE:-https://git.openstack.org}
GIT_BRANCH=${GIT_BRANCH:-master}
source $WORKSPACE/devstack-gate/functions.sh
start_timer
@ -107,7 +110,7 @@ if [ -z "$SKIP_DEVSTACK_GATE_PROJECT" ]; then
# Since we're early in the script, we need to update the d-g
# copy in the workspace, not $DEST, which is what will be
# updated later.
setup_project openstack-infra/devstack-gate master
setup_project openstack-infra/devstack-gate $GIT_BRANCH
cd $WORKSPACE
re_exec_devstack_gate
@ -215,7 +218,7 @@ if [ "$DEVSTACK_GATE_GRENADE" -eq "1" ]; then
export GRENADE_NEW_BRANCH="stable/icehouse"
else # master
export GRENADE_OLD_BRANCH="stable/icehouse"
export GRENADE_NEW_BRANCH="master"
export GRENADE_NEW_BRANCH="$GIT_BRANCH"
fi
if [ "$DEVSTACK_GATE_GRENADE_PARTIAL_NCPU" -eq "1" ]; then
export DO_NOT_UPGRADE_SERVICES=[n-cpu]
@ -230,7 +233,7 @@ elif [ "$DEVSTACK_GATE_GRENADE_FORWARD" -eq "1" ]; then
export GRENADE_NEW_BRANCH="stable/icehouse"
elif [ "$GRENADE_BASE_BRANCH" == "stable/icehouse" ]; then
export GRENADE_OLD_BRANCH="stable/icehouse"
export GRENADE_NEW_BRANCH="master"
export GRENADE_NEW_BRANCH="$GIT_BRANCH"
fi
fi

View File

@ -131,10 +131,11 @@ function git_remote_set_url {
function git_clone_and_cd {
local project=$1
local short_project=$2
local git_base=${GIT_BASE:-https://git.openstack.org}
if [[ ! -e $short_project ]]; then
echo " Need to clone $short_project"
git clone https://git.openstack.org/$project
git clone $git_base/$project
fi
cd $short_project
}
@ -208,11 +209,12 @@ function setup_project {
local project=$1
local branch=$2
local short_project=`basename $project`
local git_base=${GIT_BASE:-https://git.openstack.org}
echo "Setting up $project @ $branch"
git_clone_and_cd $project $short_project
git_remote_set_url origin https://git.openstack.org/$project
git_remote_set_url origin $git_base/$project
# allow for possible project branch override
local uc_project=`echo $short_project | tr [:lower:] [:upper:] | tr '-' '_' | sed 's/[^A-Z_]//'`