]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
.readthedocs.yml: Always build latest doc/releases pages 47444/head
authorDavid Galloway <dgallowa@redhat.com>
Thu, 30 Jun 2022 19:37:58 +0000 (15:37 -0400)
committerDavid Galloway <dgallowa@redhat.com>
Wed, 3 Aug 2022 17:32:07 +0000 (13:32 -0400)
We don't backport PRs merged into doc/releases.  Therefore, when one browses to an older Ceph release version on docs.ceph.com (e.g., https://docs.ceph.com/en/pacific/), the information is out of date at best.

The doc/releases page is only accurate if browsing https://docs.ceph.com/en/latest/, for example.

So this post_checkout command will make sure we've checked out doc/releases from main before building and publishing.

Signed-off-by: David Galloway <dgallowa@redhat.com>
(cherry picked from commit 055fe1f825b0629b7685d6d3d4d629ffc37a2d7c)

.readthedocs.yml
admin/rtd-checkout-main [new file with mode: 0755]

index 24815ce2466e4622cb65a8cb5addedfc90648a60..361c664fa22cd3864522af8e91c11e9722fd0cb0 100644 (file)
@@ -1,16 +1,27 @@
 ---
 # Read the Docs configuration file
 # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
+#
+# The pre_build command checks if we're building a named branch (i.e., not a PR).
+# If so, check out doc/releases from the main branch before building so
+# it's always up to date on docs.ceph.com/en/*.
 
 version: 2
 formats: []
 build:
-  image: latest
+  os: ubuntu-22.04
+  tools:
+    python: "3.8"
+  apt_packages:
+    - ditaa
+  jobs:
+    pre_build:
+      - bash admin/rtd-checkout-main
 python:
-  version: 3
   install:
     - requirements: admin/doc-requirements.txt
     - requirements: admin/doc-read-the-docs.txt
+    - requirements: admin/doc-pybind.txt
 sphinx:
   builder: dirhtml
   configuration: doc/conf.py
diff --git a/admin/rtd-checkout-main b/admin/rtd-checkout-main
new file mode 100755 (executable)
index 0000000..931816d
--- /dev/null
@@ -0,0 +1,6 @@
+# See .readthedocs.yml
+set -ex
+if git symbolic-ref HEAD; then
+  git checkout origin/main -- doc/releases
+fi
+git status