Rename log_path and generate-log-url

Make log_path zuul_log_path because log_path is rather generic.

Rename generate-log-url to set-zuul-log-path-fact to make it
clearer what it does.

Change-Id: I91ae1e396b3ef04939edebaeea8e5b16cc50315a
This commit is contained in:
Monty Taylor 2017-09-09 16:48:27 -06:00
parent 4a21194da7
commit 00e673c36b
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
4 changed files with 11 additions and 7 deletions

View File

@ -1,7 +1,10 @@
- include_role:
name: set-zuul-log-path-fact
- debug: - debug:
msg: "Job {{ zuul.job }} triggered from {{ zuul.change_url }}" msg: "Job {{ zuul.job }} triggered from {{ zuul.change_url }}"
when: zuul.change_url is defined when: zuul.change_url is defined
- debug: - debug:
msg: "At completion, logs for this job will be availble at "{{ zuul_log_url }}/{{ log_path }}" msg: "At completion, logs for this job will be availble at "{{ zuul_log_url }}/{{ zuul_log_path }}"
when: zuul_log_url is defined and log_path is defined when: zuul_log_url is defined and zuul_log_path is defined

View File

@ -0,0 +1 @@
Sets a fact named ``zuul_log_path`` from zuul variables

View File

@ -1,9 +1,9 @@
- include_role: - include_role:
name: generate-log-url name: set-zuul-log-path-fact
- name: Create log directories - name: Create log directories
file: file:
path: "{{zuul_logserver_root}}/{{ log_path }}" path: "{{zuul_logserver_root}}/{{ zuul_log_path }}"
state: directory state: directory
recurse: yes recurse: yes
mode: 0775 mode: 0775
@ -11,7 +11,7 @@
- name: Upload logs to log server - name: Upload logs to log server
synchronize: synchronize:
src: "{{ zuul.executor.log_root }}/" src: "{{ zuul.executor.log_root }}/"
dest: "{{zuul_logserver_root}}/{{ log_path }}/" dest: "{{zuul_logserver_root}}/{{ zuul_log_path }}/"
rsync_opts: rsync_opts:
- "--exclude=job-output.txt" - "--exclude=job-output.txt"
no_log: true no_log: true
@ -25,7 +25,7 @@
- name: Upload console log - name: Upload console log
synchronize: synchronize:
src: "{{ zuul.executor.log_root }}/job-output.txt.gz" src: "{{ zuul.executor.log_root }}/job-output.txt.gz"
dest: "{{zuul_logserver_root}}/{{ log_path }}/job-output.txt.gz" dest: "{{zuul_logserver_root}}/{{ zuul_log_path }}/job-output.txt.gz"
verify_host: true verify_host: true
- name: Return log URL to Zuul - name: Return log URL to Zuul
@ -33,5 +33,5 @@
zuul_return: zuul_return:
data: data:
zuul: zuul:
log_url: "{{ zuul_log_url }}/{{ log_path }}/" log_url: "{{ zuul_log_url }}/{{ zuul_log_path }}/"
when: zuul_log_url is defined when: zuul_log_url is defined