From f730137f49386e77df441de431357a50ac412e45 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Tue, 13 Oct 2015 16:13:39 -0700 Subject: [PATCH] Handle new release versions in doc publishing OpenStack has stopped using date based versioning. Dates sort before shorter semver'd versions which breaks the doc builds determination if the docs should be writting to root of doc location or /$TAG. We can use the old hack that we have in place for the clients on all the projects now to fix this. Change-Id: I71b0bb6604a9adf3cb898d0b3fdff77f900f83d4 --- jenkins/scripts/run-docs.sh | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/jenkins/scripts/run-docs.sh b/jenkins/scripts/run-docs.sh index a6ae55f233..9185340af1 100755 --- a/jenkins/scripts/run-docs.sh +++ b/jenkins/scripts/run-docs.sh @@ -35,15 +35,13 @@ elif echo $ZUUL_REFNAME | grep refs/tags/ >/dev/null ; then # root in the tagname dir. TAG=$(echo $ZUUL_REFNAME | sed 's/refs.tags.//') if [ ! -z $TAG ] ; then - if echo $ZUUL_PROJECT | grep 'python-.*client' ; then - # This is a hack to ignore the year.release tags in python-*client - # projects. - LATEST=$(git tag | sed -n -e '/^2012\..*$/d' -e '/^\([0-9]\+\.\?\)\+$/p' | sort -V | tail -1) - else - # Take all tags of the form (number.)+, sort them, then take the - # largest - LATEST=$(git tag | sed -n '/^\([0-9]\+\.\?\)\+$/p' | sort -V | tail -1) - fi + # This is a hack to ignore the year.release tags in projects since + # now all projects use semver based versions instead of date based + # versions. The date versions will sort higher even though they + # should not so we just special case it here. + LATEST=$(git tag | sed -n -e '/^20[0-9]\{2\}\..*$/d' -e '/^\([0-9]\+\.\?\)\{1,3\}.*$/p' | sort -V | tail -1) + # Now publish to / and /$TAG if this is the latest version or + # just /$TAG if this is not the latest version. if [ "$TAG" = "$LATEST" ] ; then # Copy the docs into a subdir if this is a tagged build mkdir doc/build/$TAG