From 6fed1caf0c51aedea1f5cbe4f2003ad6e72eeca5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Beraud?= Date: Tue, 5 Jan 2021 10:18:51 +0100 Subject: [PATCH] Allow to retrieve releasenotes requirements from a dedicated place These changes allow to store reno reqs in a dedicated place. Indeed some projects just want to build release notes without other documentation. The releasenotes playbook will use the ensure-sphinx role so I think it make sense to allow this specific use case (no doc dir available). Change-Id: I1d244bb47fb6b0b35df130f34007ff51047cd2f1 --- roles/ensure-sphinx/README.rst | 3 ++- roles/ensure-sphinx/tasks/main.yaml | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/roles/ensure-sphinx/README.rst b/roles/ensure-sphinx/README.rst index f9b4267b4..f7a97cd18 100644 --- a/roles/ensure-sphinx/README.rst +++ b/roles/ensure-sphinx/README.rst @@ -1,7 +1,8 @@ Ensure sphinx is installed Installs sphinx. Also installs any dependencies needed in the first of -doc/requirements.txt and test-requirements.txt to be found. +doc/requirements.txt, releasenotes/requirements.txt and +test-requirements.txt to be found. All pip installs are done with a provided constraints file, if given. diff --git a/roles/ensure-sphinx/tasks/main.yaml b/roles/ensure-sphinx/tasks/main.yaml index 9fcc254f7..a9d318ff7 100644 --- a/roles/ensure-sphinx/tasks/main.yaml +++ b/roles/ensure-sphinx/tasks/main.yaml @@ -26,14 +26,14 @@ name: find-constraints # We're not using with_first_found because the files are remote, not local. -# We want to use doc/requirements.txt if it exists or fallback to -# test-requirements.txt. +# We want to use doc/requirements.txt or releasenotes/requirements.txt +# if it exists else we want to fallback to test-requirements.txt. - name: Get requirements files shell: executable: /bin/bash chdir: "{{ zuul_work_dir }}" cmd: | - for f in doc/requirements.txt test-requirements.txt ; do + for f in doc/requirements.txt releasenotes/requirements.txt test-requirements.txt ; do if [ -f $f ] ; then echo $f break