diff --git a/playbooks/python/tarball-post.yaml b/playbooks/python/tarball-post.yaml index a95e85458..8efcc6c6f 100644 --- a/playbooks/python/tarball-post.yaml +++ b/playbooks/python/tarball-post.yaml @@ -34,7 +34,7 @@ zuul: artifacts: - name: "python_sdist" - url: "{{ item.path | basename }}" + url: "artifacts/{{ item.path | basename }}" metadata: type: python_sdist diff --git a/roles/download-artifact/tasks/inner.yaml b/roles/download-artifact/tasks/inner.yaml deleted file mode 100644 index a42cf3868..000000000 --- a/roles/download-artifact/tasks/inner.yaml +++ /dev/null @@ -1,8 +0,0 @@ -- name: Download archive - uri: - url: "{{ artifact.url }}" - dest: "{{ download_artifact_directory }}" - loop: "{{ build.artifacts }}" - loop_control: - loop_var: artifact - when: "artifact.name == download_artifact_name or ((download_artifact_name | type_debug) == 'list' and artifact.name in download_artifact_name)" diff --git a/roles/download-artifact/tasks/main.yaml b/roles/download-artifact/tasks/main.yaml index 6f27e4dd8..0be75f6ba 100644 --- a/roles/download-artifact/tasks/main.yaml +++ b/roles/download-artifact/tasks/main.yaml @@ -2,8 +2,14 @@ uri: url: "{{ download_artifact_api }}/builds?{{ download_artifact_query }}" register: build -- name: Process build - loop: "{{ build.json }}" +- name: Parse build response + set_fact: + build: "{{ build.json[-1] }}" +- name: Download archive + uri: + url: "{{ artifact.url }}" + dest: "{{ download_artifact_directory }}" + loop: "{{ build.artifacts }}" loop_control: - loop_var: build - include_tasks: inner.yaml + loop_var: artifact + when: "artifact.name == download_artifact_name or ((download_artifact_name | type_debug) == 'list' and artifact.name in download_artifact_name)"