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
This commit is contained in:
Ian Wienand 2020-03-20 13:08:40 +11:00
parent 476c6d918d
commit a68ddd3c5f

View File

@ -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