From 2f230e02d5b892d6d8916cbb2975e73bdb57cab6 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Wed, 27 Sep 2017 15:48:39 -0700 Subject: [PATCH] Add a role to write a root marker This is a single task within the existing afs prep role, but we need to be able to do it alone for certain special doc builds, like infra index page generation. We could use include_role in the future to de-duplicate this, once zuul_json supports that. Change-Id: Ia6c6257cb1479abef79bf919cb6ad25ea6828d90 --- roles/write-root-marker/README.rst | 9 +++++++++ roles/write-root-marker/defaults/main.yaml | 1 + roles/write-root-marker/tasks/main.yaml | 4 ++++ 3 files changed, 14 insertions(+) create mode 100644 roles/write-root-marker/README.rst create mode 100644 roles/write-root-marker/defaults/main.yaml create mode 100644 roles/write-root-marker/tasks/main.yaml diff --git a/roles/write-root-marker/README.rst b/roles/write-root-marker/README.rst new file mode 100644 index 00000000..f28f7d13 --- /dev/null +++ b/roles/write-root-marker/README.rst @@ -0,0 +1,9 @@ +Write the root marker for an AFS publishing job + +** Role Variables ** + +.. zuul:rolevar:: root_marker_dir + :default: src/{{ zuul.project.canonical_name }}/doc/build/html + + The documentation build directory. The marker file will be placed + in this directory. diff --git a/roles/write-root-marker/defaults/main.yaml b/roles/write-root-marker/defaults/main.yaml new file mode 100644 index 00000000..2fd52fba --- /dev/null +++ b/roles/write-root-marker/defaults/main.yaml @@ -0,0 +1 @@ +root_marker_dir: "src/{{ zuul.project.canonical_name }}/doc/build/html" diff --git a/roles/write-root-marker/tasks/main.yaml b/roles/write-root-marker/tasks/main.yaml new file mode 100644 index 00000000..2f7b6cbe --- /dev/null +++ b/roles/write-root-marker/tasks/main.yaml @@ -0,0 +1,4 @@ +- name: Write marker text + copy: + dest: "{{ root_marker_dir }}/.root-marker" + content: "Project: {{ zuul.project.name }} Branch: {{ zuul.branch }} Build: {{ zuul.build }} Revision: {{ zuul.ref }}"