summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2019-01-11 22:07:09 +0000
committerGerrit Code Review <review@openstack.org>2019-01-11 22:07:09 +0000
commit21ea7e83848f9f7d755c14c184858b328842bf33 (patch)
treeceaa171f02897989c54075d0cad85df4877fa374
parent243a8938f633c54fe796c32cce5d2ec70b32e169 (diff)
parenta441d749b8bfda3cac7880f901828f7c0ef04332 (diff)
Merge "Add role to move docs and artifacts to log root"
-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