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