]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
admin: Fix check if PR or release branch docs build 47737/head
authorDavid Galloway <dgallowa@redhat.com>
Mon, 22 Aug 2022 20:29:01 +0000 (16:29 -0400)
committerDavid Galloway <dgallowa@redhat.com>
Mon, 22 Aug 2022 20:40:09 +0000 (16:40 -0400)
Uses built-in RTD vars.  https://docs.readthedocs.io/en/stable/environment-variables.html.

Follow up to https://github.com/ceph/ceph/pull/46917#discussion_r942359130.

Signed-off-by: David Galloway <dgallowa@redhat.com>
admin/rtd-checkout-main

index 931816dce9ed53035a48575e47a7e619cd08c7b4..829d7c384699137ec64e9da45f0f3732e7a4de69 100755 (executable)
@@ -1,6 +1,10 @@
 # See .readthedocs.yml
 set -ex
-if git symbolic-ref HEAD; then
+re='^[0-9]+$'
+if [[ $READTHEDOCS_VERSION =~ $re ]]; then
+  echo "Building docs for PR $READTHEDOCS_VERSION.  Will not check out doc/releases from main branch."
+else
+  echo "Building docs for $READTHEDOCS_VERSION branch.  Will check out doc/releases from main branch."
   git checkout origin/main -- doc/releases
 fi
 git status