From 00e673c36b3a8683e364140949a18eaf4c18997e Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Sat, 9 Sep 2017 16:48:27 -0600 Subject: [PATCH] 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 --- roles/emit-job-header/tasks/main.yaml | 7 +++++-- roles/set-zuul-log-path-fact/README.rst | 1 + .../tasks/main.yaml | 0 roles/upload-logs/tasks/main.yaml | 10 +++++----- 4 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 roles/set-zuul-log-path-fact/README.rst rename roles/{generate-log-url => set-zuul-log-path-fact}/tasks/main.yaml (100%) diff --git a/roles/emit-job-header/tasks/main.yaml b/roles/emit-job-header/tasks/main.yaml index 8bd780707..5ca34eb67 100644 --- a/roles/emit-job-header/tasks/main.yaml +++ b/roles/emit-job-header/tasks/main.yaml @@ -1,7 +1,10 @@ +- include_role: + name: set-zuul-log-path-fact + - debug: msg: "Job {{ zuul.job }} triggered from {{ zuul.change_url }}" when: zuul.change_url is defined - debug: - msg: "At completion, logs for this job will be availble at "{{ zuul_log_url }}/{{ log_path }}" - when: zuul_log_url is defined and log_path is defined + msg: "At completion, logs for this job will be availble at "{{ zuul_log_url }}/{{ zuul_log_path }}" + when: zuul_log_url is defined and zuul_log_path is defined diff --git a/roles/set-zuul-log-path-fact/README.rst b/roles/set-zuul-log-path-fact/README.rst new file mode 100644 index 000000000..d64eec8af --- /dev/null +++ b/roles/set-zuul-log-path-fact/README.rst @@ -0,0 +1 @@ +Sets a fact named ``zuul_log_path`` from zuul variables diff --git a/roles/generate-log-url/tasks/main.yaml b/roles/set-zuul-log-path-fact/tasks/main.yaml similarity index 100% rename from roles/generate-log-url/tasks/main.yaml rename to roles/set-zuul-log-path-fact/tasks/main.yaml diff --git a/roles/upload-logs/tasks/main.yaml b/roles/upload-logs/tasks/main.yaml index b0ceb2e8a..16575be5e 100644 --- a/roles/upload-logs/tasks/main.yaml +++ b/roles/upload-logs/tasks/main.yaml @@ -1,9 +1,9 @@ - include_role: - name: generate-log-url + name: set-zuul-log-path-fact - name: Create log directories file: - path: "{{zuul_logserver_root}}/{{ log_path }}" + path: "{{zuul_logserver_root}}/{{ zuul_log_path }}" state: directory recurse: yes mode: 0775 @@ -11,7 +11,7 @@ - name: Upload logs to log server synchronize: src: "{{ zuul.executor.log_root }}/" - dest: "{{zuul_logserver_root}}/{{ log_path }}/" + dest: "{{zuul_logserver_root}}/{{ zuul_log_path }}/" rsync_opts: - "--exclude=job-output.txt" no_log: true @@ -25,7 +25,7 @@ - name: Upload console log synchronize: 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 - name: Return log URL to Zuul @@ -33,5 +33,5 @@ zuul_return: data: zuul: - log_url: "{{ zuul_log_url }}/{{ log_path }}/" + log_url: "{{ zuul_log_url }}/{{ zuul_log_path }}/" when: zuul_log_url is defined