diff --git a/doc/source/js-jobs.rst b/doc/source/js-jobs.rst index 200648466..e78e84ab7 100644 --- a/doc/source/js-jobs.rst +++ b/doc/source/js-jobs.rst @@ -3,6 +3,7 @@ Javascript Jobs .. zuul:autojob:: build-javascript-tarball .. zuul:autojob:: build-javascript-content +.. zuul:autojob:: build-javascript-content-tarball .. zuul:autojob:: nodejs-npm .. zuul:autojob:: nodejs-npm-run-test .. zuul:autojob:: nodejs-npm-run-lint diff --git a/playbooks/javascript/tarball.yaml b/playbooks/javascript/tarball.yaml new file mode 100644 index 000000000..2ba7f711a --- /dev/null +++ b/playbooks/javascript/tarball.yaml @@ -0,0 +1,3 @@ +- hosts: all + roles: + - fetch-javascript-content-tarball diff --git a/roles/fetch-javascript-content-tarball/tasks/main.yaml b/roles/fetch-javascript-content-tarball/tasks/main.yaml index 8a9152f52..1eddd9d00 100644 --- a/roles/fetch-javascript-content-tarball/tasks/main.yaml +++ b/roles/fetch-javascript-content-tarball/tasks/main.yaml @@ -36,3 +36,21 @@ mode: pull src: "{{ zuul_work_dir }}/dist/" verify_host: true + +- name: Find content tarball + find: + file_type: file + paths: "{{ zuul_work_dir }}/dist/" + patterns: "*.tar.gz" + register: result + +- name: Return artifacts to Zuul + loop: "{{ result.files }}" + zuul_return: + data: + zuul: + artifacts: + - name: javascript_content + url: "{{ item.path | basename }}" + metadata: + type: javascript_content diff --git a/zuul.yaml b/zuul.yaml index 2a7eb88f0..7c4a08984 100644 --- a/zuul.yaml +++ b/zuul.yaml @@ -488,6 +488,40 @@ Directory, relative to zuul_work_dir, holding build content. success-url: npm/html/ +- job: + name: build-javascript-content-tarball + parent: nodejs-npm + description: | + Build an archive of javascript web content as it should be deployed. + + Responds to these variables: + + .. zuul:jobvar:: npm_command + :default: build + + Command to pass to npm. + + .. zuul:jobvar:: node_version + :default: 6 + + The version of Node to use. + + .. zuul:jobvar: zuul_work_dir + :default: {{ zuul.project.src_dir }} + + Path to operate in. + + .. zuul:jobvar: javascript_content_dir + :default: dist + + Directory, relative to zuul_work_dir, holding build content. + + .. zuul:jobvar: create_tarball_directory + + Create a tarball with the contents of + create_tarball_directory (relative to zuul_work_dir). + post-run: playbooks/javascript/tarball.yaml + - job: name: nodejs-npm-run-test parent: nodejs-npm