Checkout from -eol tag if stable branch does not exist

Since several projects stable/newton branches have been end of life'd,
we can't install base devstack on stable/newton.

This modifies the setup_workspace function to check, as a last resort,
if the base_branch is a stable branch and if there is a corresponding
-eol tag, to use that for the checkout rather than the stable branch.

This is needed in the cases that projects are end of life'd out of order,
as is the case with keystone, cinder and neutron being end of life before
nova for stable/newton.

Co-Authored-By: Eric Fried <efried@us.ibm.com>

Change-Id: I344d8fdded9b7d5385fcb41b699f1352acb4cda7
This commit is contained in:
Matt Riedemann 2017-11-15 09:54:26 -05:00
parent 837072abbc
commit b8db7d219e
1 changed files with 6 additions and 0 deletions

View File

@ -419,6 +419,12 @@ function setup_workspace {
cd `basename $PROJECT`
if git branch -a | grep "$base_branch" > /dev/null ; then
git checkout $base_branch
elif [[ "$base_branch" == stable/* ]]; then
# Look for an eol tag for the stable branch.
eol_tag=${base_branch#stable/}-eol
if [ $(git tag -l $eol_tag) ]; then
git checkout -q $eol_tag
fi
else
git checkout master
fi