zuul-jobs/roles/upload-logs/tasks/main.yaml
James E. Blair dcd89b2686 Revert "Fix linting issues found via project-config"
This has syntax errors.

This reverts commit d3128dab95.

Change-Id: Ida6569d384f50095cc228625c7d6e73e154270ae
2017-09-14 13:10:22 -06:00

45 lines
1.1 KiB
YAML

- include_role:
name: set-zuul-log-path-fact
- name: Create log directories
file:
path: "{{zuul_logserver_root}}/{{ zuul_log_path }}"
state: directory
recurse: yes
mode: 0775
- name: Upload logs to log server
synchronize:
src: "{{ zuul.executor.log_root }}/"
dest: "{{zuul_logserver_root}}/{{ zuul_log_path }}/"
rsync_opts:
- "--exclude=job-output.txt"
- "--exclude=job-output.json"
no_log: true
# 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 }}"
with_items:
- job-output.txt
- job-output.json
- name: Upload console log and json output
synchronize:
src: "{{ zuul.executor.log_root }}/{{ item }}.gz"
dest: "{{zuul_logserver_root}}/{{ zuul_log_path }}/{{ item }}.gz"
verify_host: true
with_items:
- job-output.txt
- job-output.json
- name: Return log URL to Zuul
delegate_to: localhost
zuul_return:
data:
zuul:
log_url: "{{ zuul_log_url }}/{{ zuul_log_path }}/"
when: zuul_log_url is defined