Only upload logs when jobs fail

We're having some major disk issues. Help the situation by only
uploading failure logs.

Change-Id: I4156fb59570d98b16c775752639c2fe23e5777c5
This commit is contained in:
Monty Taylor 2018-01-25 09:02:47 -06:00
parent 6283695966
commit c999f9325f
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594

View File

@ -2,14 +2,19 @@
include_role:
name: set-zuul-log-path-fact
- name: Create log directories
# NOTE(mordred) Temporary hack to only upload logs on failures to work around
# unfortunately timed disk outage.
- when: not zuul_success|bool
block:
- name: Create log directories
file:
path: "{{zuul_logserver_root}}/{{ zuul_log_path }}"
state: directory
recurse: yes
mode: 0775
- name: Ensure logs are readable before uploading
- name: Ensure logs are readable before uploading
delegate_to: localhost
file:
path: "{{ zuul.executor.log_root }}/"
@ -17,7 +22,7 @@
state: directory
recurse: yes
- name: Upload logs to log server
- name: Upload logs to log server
synchronize:
src: "{{ zuul.executor.log_root }}/"
dest: "{{zuul_logserver_root}}/{{ zuul_log_path }}/"
@ -26,8 +31,8 @@
- "--exclude=job-output.json"
no_log: true
# After this point there are no more logs
- name: gzip console log and json output
# After this point there are no more logs
- name: gzip console log and json output
delegate_to: localhost
archive:
path: "{{ zuul.executor.log_root }}/{{ item }}"
@ -35,7 +40,7 @@
- job-output.txt
- job-output.json
- name: Upload console log and json output
- name: Upload console log and json output
synchronize:
src: "{{ zuul.executor.log_root }}/{{ item }}.gz"
dest: "{{zuul_logserver_root}}/{{ zuul_log_path }}/{{ item }}.gz"