From 6bb8096a0eb5de50adf2af7ca0e8e9b6c5d9f0c2 Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Wed, 23 Aug 2017 11:04:52 -0400 Subject: [PATCH] Add fetch-python-sdist-output role Create a role to upload python sdist results to artifact directory on executor. Change-Id: I05158958af793fcfaef1d978cb7f38a38af95fc6 Signed-off-by: Paul Belanger --- roles/fetch-python-sdist-output/README.rst | 1 + .../fetch-python-sdist-output/tasks/main.yaml | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 roles/fetch-python-sdist-output/README.rst create mode 100644 roles/fetch-python-sdist-output/tasks/main.yaml diff --git a/roles/fetch-python-sdist-output/README.rst b/roles/fetch-python-sdist-output/README.rst new file mode 100644 index 000000000..357f327c3 --- /dev/null +++ b/roles/fetch-python-sdist-output/README.rst @@ -0,0 +1 @@ +Collect output from a python sdist build diff --git a/roles/fetch-python-sdist-output/tasks/main.yaml b/roles/fetch-python-sdist-output/tasks/main.yaml new file mode 100644 index 000000000..6eb37a283 --- /dev/null +++ b/roles/fetch-python-sdist-output/tasks/main.yaml @@ -0,0 +1,25 @@ +- name: Find tarballs and wheels in dist folder + find: + file_type: file + paths: "src/{{ zuul.project.canonical_name }}/dist" + patterns: "*.tar.gz,*.whl" + register: result + +- name: Display stat for tarballs and wheels + stat: + path: "{{ item.path }}" + with_items: "{{ result.files }}" + +- name: Ensure artifacts directory exists + file: + path: "{{ zuul.executor.work_root }}/artifacts" + state: directory + delegate_to: localhost + +- name: Collect artifacts + synchronize: + dest: "{{ zuul.executor.work_root }}/artifacts/" + mode: pull + src: "{{ item.path }}" + verify_host: true + with_items: "{{ result.files }}"