Skip to content

Commit

Permalink
Gather artifacts for jobs without change
Browse files Browse the repository at this point in the history
merge-output-to-logs role is not copying artifacts for jobs without a
change. We need those i.e. to keep artifacts of the periodic
certification verification jobs.

Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
  • Loading branch information
gtema committed Sep 19, 2024
1 parent 9055c65 commit fdcb219
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions playbooks/base/post.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,28 @@
name: merge-output-to-logs
when: ansible_user_dir is defined

# This is a copy from the merge-output-to-logs which does not copy
# artifacts for jobs without a change. While it makes sense to some
# extend there are cases where it is desired (fetching artifacts of
# periodic jobs).
- name: Move artifacts and docs to logs dir
when: zuul.change is not defined
delegate_to: localhost
shell: |
if [ -n "$(find {{ zuul.executor.work_root }}/{{ zj_item }} -mindepth 1)" ] ; then
# Only create target directory if it is needed.
# Do not fail if it is already there.
mkdir -p {{ zuul.executor.log_root }}/{{ zj_item }}
# Leave the original directory behind so that other roles
# operating on the interface directories can simply no-op.
mv -f {{ zuul.executor.work_root }}/{{ zj_item }}/* {{ zuul.executor.log_root }}/{{ zj_item }}
fi
loop:
- artifacts
loop_control:
loop_var: zj_item
run_once: true

- hosts: all
ignore_errors: yes
tasks:
Expand Down

0 comments on commit fdcb219

Please sign in to comment.