68ee0780be
In change If9ebdc783dcef4f8dea9fa491b40ae49416e5cf1 in zuul uuid was renamed to build. This must be also reflected here. Change-Id: I46101d7a9ecc1513647f19d1d377480d5afa9a5d
37 lines
1.1 KiB
YAML
37 lines
1.1 KiB
YAML
- name: Set log path for a change
|
|
when: zuul.change is defined
|
|
set_fact:
|
|
log_path: "{{ zuul.change[-2:] }}/{{ zuul.change }}/{{ zuul.patchset }}/{{ zuul.pipeline }}/{{ zuul.job }}/{{ zuul.build[:7] }}"
|
|
|
|
- name: Set log path for a ref update
|
|
when: zuul.newrev is defined
|
|
set_fact:
|
|
log_path: "{{ zuul.newrev[-2:] }}/{{ zuul.newrev }}/{{ zuul.pipeline }}/{{ zuul.job }}/{{ zuul.build[:7] }}"
|
|
|
|
- name: Create log directories
|
|
file:
|
|
path: "{{zuul_logserver_root}}/{{ log_path }}"
|
|
state: directory
|
|
recurse: yes
|
|
mode: 0775
|
|
|
|
- name: Upload logs to log server
|
|
synchronize:
|
|
src: "{{ zuul.executor.log_root }}/"
|
|
dest: "{{zuul_logserver_root}}/{{ log_path }}/"
|
|
rsync_opts:
|
|
- "--exclude=job-output.txt"
|
|
no_log: true
|
|
|
|
# After this point there are no more logs
|
|
- name: gzip console log
|
|
delegate_to: localhost
|
|
archive:
|
|
path: "{{ zuul.executor.log_root }}/job-output.txt"
|
|
|
|
- name: Upload console log
|
|
synchronize:
|
|
src: "{{ zuul.executor.log_root }}/job-output.txt.gz"
|
|
dest: "{{zuul_logserver_root}}/{{ log_path }}/job-output.txt.gz"
|
|
verify_host: true
|