From a327047c14c3e80bb08ce2deed97d08361950e96 Mon Sep 17 00:00:00 2001 From: Tristan Cacqueray Date: Sun, 30 Sep 2018 00:01:25 +0000 Subject: [PATCH] fetch-javascript-content-tarball: add create_tarball variable This change enable publish job to also create the tarball before fetch. Change-Id: If4b5a1be8d3ce61ff45b04be23cf80a802760ec8 --- roles/fetch-javascript-content-tarball/README.rst | 5 +++++ roles/fetch-javascript-content-tarball/tasks/main.yaml | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/roles/fetch-javascript-content-tarball/README.rst b/roles/fetch-javascript-content-tarball/README.rst index f8ff1d31e..25fb10512 100644 --- a/roles/fetch-javascript-content-tarball/README.rst +++ b/roles/fetch-javascript-content-tarball/README.rst @@ -9,3 +9,8 @@ such as but not limited to those produced by the webpack ArchivePlugin. :default: {{ zuul.project.src_dir }} Directory to work in. + +.. zuul:rolevar:: create_tarball_directory + + Create a tarball with the contents of create_tarball_directory + (relative to zuul_work_dir). diff --git a/roles/fetch-javascript-content-tarball/tasks/main.yaml b/roles/fetch-javascript-content-tarball/tasks/main.yaml index b02ced804..cc2e69aae 100644 --- a/roles/fetch-javascript-content-tarball/tasks/main.yaml +++ b/roles/fetch-javascript-content-tarball/tasks/main.yaml @@ -1,3 +1,12 @@ +- name: Create tarball + shell: "tar czf {{ zuul_work_dir }}/build.tgz *" + args: + chdir: "{{ zuul_work_dir }}/{{ create_tarball_directory }}" + when: create_tarball_directory is defined + tags: + # Ignore ANSIBLE0006: tar used in place of unarchive module + - skip_ansible_lint + - name: Rename tarball for uploading shell: | mkdir -p dist