From 735a8f7c9abf85d3a19bf04b4342d1dd224bc3ea Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Fri, 27 Oct 2017 14:15:36 -0400 Subject: [PATCH] Create fetch-puppet-module-output role We'll be using this for puppet(-branch)-tarball jobs to publish to artifacts site. Change-Id: I4da68c8b1f89e2e04f4b94eebf29905c24aea474 Signed-off-by: Paul Belanger --- roles/fetch-puppet-module-output/README.rst | 1 + .../tasks/main.yaml | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 roles/fetch-puppet-module-output/README.rst create mode 100644 roles/fetch-puppet-module-output/tasks/main.yaml diff --git a/roles/fetch-puppet-module-output/README.rst b/roles/fetch-puppet-module-output/README.rst new file mode 100644 index 000000000..c0458343a --- /dev/null +++ b/roles/fetch-puppet-module-output/README.rst @@ -0,0 +1 @@ +Collect output from a puppet module build diff --git a/roles/fetch-puppet-module-output/tasks/main.yaml b/roles/fetch-puppet-module-output/tasks/main.yaml new file mode 100644 index 000000000..089843d31 --- /dev/null +++ b/roles/fetch-puppet-module-output/tasks/main.yaml @@ -0,0 +1,25 @@ +- name: Find tarballs in pkg folder + find: + file_type: file + paths: "src/{{ zuul.project.canonical_name }}/pkg" + patterns: "*.tar.gz" + register: result + +- name: Display stat for tarballs + 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 }}"