summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2019-01-09 17:02:16 +0000
committerMonty Taylor <mordred@inaugust.com>2019-01-10 22:48:30 +0000
commita441d749b8bfda3cac7880f901828f7c0ef04332 (patch)
tree6311803192140ed6858d9f726c8ea00db84be780
parent0630797da82ce49b4904de90892d696ddb043d5d (diff)
Add role to move docs and artifacts to log root
When we're operating in the context of a change, we'd like to upload artifacts and docs to the log server so that people can iterate on them before publication safely. Add a role which is intended to be run after fetch-output that moves the content on the executor so that normal log upload concepts can be applied. Change-Id: I1791d1283a0c1f112958db8861526145abe1357c
Notes
Notes (review): Code-Review+2: Andreas Jaeger <jaegerandi@gmail.com> Code-Review+2: Clark Boylan <cboylan@sapwetik.org> Workflow+1: Clark Boylan <cboylan@sapwetik.org> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Fri, 11 Jan 2019 22:07:09 +0000 Reviewed-on: https://review.openstack.org/629571 Project: openstack-infra/zuul-jobs Branch: refs/heads/master
-rw-r--r--roles/merge-output-to-logs/README.rst14
-rw-r--r--roles/merge-output-to-logs/tasks/main.yaml15
2 files changed, 29 insertions, 0 deletions
diff --git a/roles/merge-output-to-logs/README.rst b/roles/merge-output-to-logs/README.rst
new file mode 100644
index 0000000..3b0b643
--- /dev/null
+++ b/roles/merge-output-to-logs/README.rst
@@ -0,0 +1,14 @@
1Put artifacts and docs into the executor log dir
2
3.. note::
4
5 This role only works in a trusted context. It is intended to
6 be used in the post playbook of a base job.
7
8This role moves artifacts and docs into the logs dir when
9``zuul.change`` is defined so that they can be uploaded to the
10log server for developer preview and validation.
11
12Artifacts and docs are left in place when ``zuul.change`` is
13not defined so that normal publication jobs can publish them
14to final locations.
diff --git a/roles/merge-output-to-logs/tasks/main.yaml b/roles/merge-output-to-logs/tasks/main.yaml
new file mode 100644
index 0000000..d1fa111
--- /dev/null
+++ b/roles/merge-output-to-logs/tasks/main.yaml
@@ -0,0 +1,15 @@
1- name: Move artifacts and docs to logs dir
2 when: zuul.change is defined
3 delegate_to: localhost
4 shell: |
5 if ! $(ls {{ zuul.executor.work_root }}/{{ item }}) ; then
6 # Only create target directory if it is needed.
7 # Do not fail if it is already there.
8 mkdir -p {{ zuul.executor.log_root }}/{{ item }}
9 # Leave the original directory behind so that other roles
10 # operating on the interface directories can simply no-op.
11 mv -f {{ zuul.executor.work_root }}/{{ item }}/* {{ zuul.executor.log_root }}/{{ item }}
12 fi
13 loop:
14 - artifacts
15 - docs