diff --git a/roles/upload-logs/README.rst b/roles/upload-logs/README.rst index 7df56e370..26c4689c0 100644 --- a/roles/upload-logs/README.rst +++ b/roles/upload-logs/README.rst @@ -29,6 +29,13 @@ description of the site_logs secret in this example post-run playbook: The root path to the logs on the logserver. +.. zuul:rolevar:: zuul_log_compress + :default: false + + When enabled, the console logs Zuul produces will be compressed + before uploading. You may need additional configuration for your web + server to view these files. + .. zuul:rolevar:: zuul_log_verbose :default: false diff --git a/roles/upload-logs/tasks/main.yaml b/roles/upload-logs/tasks/main.yaml index cd2b46a4c..e692f995a 100644 --- a/roles/upload-logs/tasks/main.yaml +++ b/roles/upload-logs/tasks/main.yaml @@ -40,8 +40,9 @@ with_items: - job-output.txt - job-output.json + when: zuul_log_compress | bool - - name: Upload console log and json output + - name: Upload compressed console log and json output synchronize: src: "{{ zuul.executor.log_root }}/{{ item }}.gz" dest: "{{ zuul_logserver_root }}/{{ zuul_log_path }}/{{ item }}.gz" @@ -49,6 +50,17 @@ with_items: - job-output.txt - job-output.json + when: zuul_log_compress | bool + + - name: Upload console log and json output + synchronize: + src: "{{ zuul.executor.log_root }}/{{ item }}" + dest: "{{ zuul_logserver_root }}/{{ zuul_log_path }}/{{ item }}" + verify_host: true + with_items: + - job-output.txt + - job-output.json + when: not zuul_log_compress | bool - name: Return log URL to Zuul delegate_to: localhost diff --git a/roles/upload-logs/vars/main.yaml b/roles/upload-logs/vars/main.yaml index c3a3be79e..8848aeefa 100644 --- a/roles/upload-logs/vars/main.yaml +++ b/roles/upload-logs/vars/main.yaml @@ -1,2 +1,3 @@ zuul_logserver_root: /srv/static/logs +zuul_log_compress: false zuul_log_verbose: false