Return javascript content artifact records to Zuul

When producing javascript content tarballs, return artifact records
to Zuul.

Add a new job, build-javascript-content-tarball, which includes the
role to fetch javascript content tarballs.

Change-Id: Ia247054d0523b81916815151fd57138469f634e0
This commit is contained in:
James E. Blair 2019-06-04 07:48:52 -07:00 committed by Andreas Jaeger
parent 6523b6a530
commit e23ece5e55
4 changed files with 56 additions and 0 deletions

View File

@ -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

View File

@ -0,0 +1,3 @@
- hosts: all
roles:
- fetch-javascript-content-tarball

View File

@ -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

View File

@ -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