summaryrefslogtreecommitdiff
path: root/roles/merge-output-to-logs/tasks/main.yaml
blob: d1fa1116e1b8f6cff4fe2e5dc91e5d4b493359c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
- name: Move artifacts and docs to logs dir
  when: zuul.change is defined
  delegate_to: localhost
  shell: |
    if ! $(ls {{ zuul.executor.work_root }}/{{ item }}) ; then
      # Only create target directory if it is needed.
      # Do not fail if it is already there.
      mkdir -p {{ zuul.executor.log_root }}/{{ 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 }}/{{ item }}/* {{ zuul.executor.log_root }}/{{ item }}
    fi
  loop:
    - artifacts
    - docs