From b8db7d219e02086ffd2282c0aa75c48bcf4ef2bf Mon Sep 17 00:00:00 2001 From: Matt Riedemann Date: Wed, 15 Nov 2017 09:54:26 -0500 Subject: [PATCH] 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 Change-Id: I344d8fdded9b7d5385fcb41b699f1352acb4cda7 --- functions.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/functions.sh b/functions.sh index a83664e1..9046576f 100644 --- a/functions.sh +++ b/functions.sh @@ -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