From f8aede8c49b8676337277453bc77793d66cab873 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Thu, 15 Oct 2015 11:26:30 -0700 Subject: [PATCH] Ignore non release versions when publishing latest docs Ignore alpha, beta, rc versions when determining if we are publishing the latest version of a projects documentation. These pre release versions will still publish to /developer/project/$version but won't update the root location of /developer/project. This works around an issue with sort -V sorting the alphas, betas, and rcs higher than the actual release. It also arguable better represents what we want to do when publishing the latest of a release. Change-Id: I2a4cd00414dee2e8307c681ed2bc6b61f7c670d6 --- jenkins/scripts/run-docs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins/scripts/run-docs.sh b/jenkins/scripts/run-docs.sh index 7cfff31586..ae0a263f12 100755 --- a/jenkins/scripts/run-docs.sh +++ b/jenkins/scripts/run-docs.sh @@ -40,7 +40,7 @@ elif echo $ZUUL_REFNAME | grep refs/tags/ >/dev/null ; then # 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) + LATEST=$(git tag | sed -n -e '/^20[0-9]\{2\}\..*$/d' -e '/^[0-9]\+\(\.[0-9]\+\)*$/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