Add DOCS_REQIREMENTS variable to RTD Gitlab job 16/72716/1
authorTrevor Bramwell <tbramwell@linuxfoundation.org>
Mon, 28 Jun 2021 22:01:41 +0000 (15:01 -0700)
committerTrevor Bramwell <tbramwell@linuxfoundation.org>
Mon, 28 Jun 2021 22:01:41 +0000 (15:01 -0700)
This will allow requirements.txt to exist at any arbitrary path in the
repository and not solely under the documentation root.

Change-Id: I48ec620d3afb09d509e6b4e9fae54da1b7cb217a
Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
gitlab-templates/RTD.gitlab-ci.yml

index 5b838d2..5e2f55b 100644 (file)
 #
 # Scheduled builds can be enabled when creating a schedule job and
 # specifying DOCS_SCHEDULE = "true" in build variables
+#
+# If extra dependencies are needed for builds they will be installed
+# from the $DOCS_REQUIREMENTS location.
 ---
 variables:
   PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
   DOCS_DIRECTORY: "docs"
+  DOCS_REQUIREMENTS: "$DOCS_DIRECTORY/requirements.txt"
 
 .docs-cache: &docs-cache
   paths:
@@ -36,8 +40,8 @@ variables:
   - source venv/bin/activate
   - pip install Sphinx
   - |
-    if [ -f "$DOCS_DIRECTORY/requirements.txt" ]; then
-      pip install -r "$DOCS_DIRECTORY/requirements.txt"
+    if [ -f "$DOCS_REQUIREMENTS" ]; then
+      pip install -r "$DOCS_REQUIREMENTS"
     fi
 
 docs-build: