From a68ddd3c5f65d47005cb512fe30f49264a6df5f6 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Fri, 20 Mar 2020 13:08:40 +1100 Subject: [PATCH] test-upload-logs-swift: fix download link We can just find the basename of the template file, and return that -- the artifact will be a relative URL which will be right. For additional help, add a metadata string you could copy-paste to download. Change-Id: I1a6f931fdd1613d1e51a20ed76a69c76bbb14dc1 --- roles/test-upload-logs-swift/tasks/main.yaml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/roles/test-upload-logs-swift/tasks/main.yaml b/roles/test-upload-logs-swift/tasks/main.yaml index 320483989..80d40007a 100644 --- a/roles/test-upload-logs-swift/tasks/main.yaml +++ b/roles/test-upload-logs-swift/tasks/main.yaml @@ -37,13 +37,21 @@ download_template: "{{ download_template | default(omit) }}" register: upload_results + - name: Get download script name + set_fact: + download_script: "{{ zuul_log_download_template | basename | regex_replace('\\.j2$') }}" + when: + - zuul_log_include_download_script + - name: Set download template artifact zuul_return: data: zuul: artifacts: - - name: bulk-download - url: '{{ upload_results.url }}/{{ zuul_log_download_template[:-3] }}' + - name: Download all logs + url: '{{ download_script }}' + metadata: + command: 'curl "{{ upload_results.url }}/{{ download_script }}" | bash' when: - zuul_log_include_download_script