Merge "Add role for fetching javascript built content"
This commit is contained in:
commit
c8b2ecf59a
11
roles/fetch-javascript-content-tarball/README.rst
Normal file
11
roles/fetch-javascript-content-tarball/README.rst
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
Fetch a Javascript content tarball back to be published.
|
||||||
|
|
||||||
|
A content tarball is one that contains built javascript/css artifacts,
|
||||||
|
such as but not limited to those produced by the webpack ArchivePlugin.
|
||||||
|
|
||||||
|
**Role Variables**
|
||||||
|
|
||||||
|
.. zuul:rolevar:: zuul_work_dir
|
||||||
|
:default: {{ zuul.project.src_dir }}
|
||||||
|
|
||||||
|
Directory to work in.
|
@ -0,0 +1 @@
|
|||||||
|
zuul_work_dir: "{{ zuul.project.src_dir }}"
|
29
roles/fetch-javascript-content-tarball/tasks/main.yaml
Normal file
29
roles/fetch-javascript-content-tarball/tasks/main.yaml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
- name: Rename tarball for uploading
|
||||||
|
shell: |
|
||||||
|
mkdir -p dist
|
||||||
|
cp *.tgz dist/{{ zuul.project.short_name }}-content-latest.tar.gz
|
||||||
|
args:
|
||||||
|
chdir: "{{ zuul_work_dir }}"
|
||||||
|
tags:
|
||||||
|
# Ignore ANSIBLE0007: No need to use file module instead of mkdir
|
||||||
|
- skip_ansible_lint
|
||||||
|
|
||||||
|
- name: Rename tagged tarball for uploading
|
||||||
|
when: zuul.tag is defined
|
||||||
|
shell: |
|
||||||
|
cp *.tgz dist/{{ zuul.project.short_name }}-content-{{ zuul.tag }}.tar.gz
|
||||||
|
args:
|
||||||
|
chdir: "{{ zuul_work_dir }}"
|
||||||
|
|
||||||
|
- 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: "{{ zuul_work_dir }}/dist/"
|
||||||
|
verify_host: true
|
Loading…
Reference in New Issue
Block a user