Fetch built web content in javascript jobs
If a javascript job produces web content that should be deployed (such as zuul-web or storyboard-webclient) we should collect that in the post step of the job and put it into the html/ directory. While in there, add a bunch of get_*: false entries for the stat calls. Calculating the md5 and whatnot is expensive, and we should really always set them to false unless we're *using* the hash values. Change-Id: I9b96656aa5f225e4b069a78442cf0159cadc9009
This commit is contained in:
parent
8a86f7c7fc
commit
89f68c5ca0
@ -1,4 +1,4 @@
|
|||||||
Collect logs from a javascript build
|
Collect outputs from a javascript build
|
||||||
|
|
||||||
**Role Variables**
|
**Role Variables**
|
||||||
|
|
||||||
@ -6,3 +6,9 @@ Collect logs from a javascript build
|
|||||||
:default: {{ zuul.project.src_dir }}
|
:default: {{ zuul.project.src_dir }}
|
||||||
|
|
||||||
Directory to work in
|
Directory to work in
|
||||||
|
|
||||||
|
.. zuul:rolevar:: javascript_content_dir
|
||||||
|
:default: dist
|
||||||
|
|
||||||
|
Directory, relative to zuul_work_dir, in which javascript output content
|
||||||
|
is to be found.
|
||||||
|
@ -1 +1,2 @@
|
|||||||
zuul_work_dir: "{{ zuul.project.src_dir }}"
|
zuul_work_dir: "{{ zuul.project.src_dir }}"
|
||||||
|
javascript_content_dir: dist
|
||||||
|
@ -17,11 +17,17 @@
|
|||||||
- name: Check for yarn.lock
|
- name: Check for yarn.lock
|
||||||
stat:
|
stat:
|
||||||
path: "{{ zuul_work_dir }}/yarn.lock"
|
path: "{{ zuul_work_dir }}/yarn.lock"
|
||||||
|
get_checksum: false
|
||||||
|
get_mime: false
|
||||||
|
get_md5: false
|
||||||
register: yarn_lock
|
register: yarn_lock
|
||||||
|
|
||||||
- name: Check for shrinkwrap
|
- name: Check for shrinkwrap
|
||||||
stat:
|
stat:
|
||||||
path: "{{ zuul_work_dir }}/npm-shrinkwrap.json"
|
path: "{{ zuul_work_dir }}/npm-shrinkwrap.json"
|
||||||
|
get_checksum: false
|
||||||
|
get_mime: false
|
||||||
|
get_md5: false
|
||||||
when: not yarn_lock.stat.exists
|
when: not yarn_lock.stat.exists
|
||||||
register: shrinkwrap
|
register: shrinkwrap
|
||||||
|
|
||||||
@ -48,6 +54,9 @@
|
|||||||
- name: Check for reports
|
- name: Check for reports
|
||||||
stat:
|
stat:
|
||||||
path: "{{ zuul_work_dir }}/reports"
|
path: "{{ zuul_work_dir }}/reports"
|
||||||
|
get_checksum: false
|
||||||
|
get_mime: false
|
||||||
|
get_md5: false
|
||||||
register: reports_stat
|
register: reports_stat
|
||||||
|
|
||||||
- name: Collect npm reports
|
- name: Collect npm reports
|
||||||
@ -61,6 +70,9 @@
|
|||||||
- name: Check for karma.subunit files
|
- name: Check for karma.subunit files
|
||||||
stat:
|
stat:
|
||||||
path: "{{ zuul_work_dir }}/karma.subunit"
|
path: "{{ zuul_work_dir }}/karma.subunit"
|
||||||
|
get_checksum: false
|
||||||
|
get_mime: false
|
||||||
|
get_md5: false
|
||||||
register: karma_stat
|
register: karma_stat
|
||||||
|
|
||||||
- name: Collect karma subunit files
|
- name: Collect karma subunit files
|
||||||
@ -75,6 +87,9 @@
|
|||||||
when: not yarn_lock.stat.exists
|
when: not yarn_lock.stat.exists
|
||||||
stat:
|
stat:
|
||||||
path: "{{ zuul_work_dir }}/npm-shrinkwrap.json"
|
path: "{{ zuul_work_dir }}/npm-shrinkwrap.json"
|
||||||
|
get_checksum: false
|
||||||
|
get_mime: false
|
||||||
|
get_md5: false
|
||||||
register: shrinkwrap_final
|
register: shrinkwrap_final
|
||||||
|
|
||||||
- name: Collect shrinkwrap file
|
- name: Collect shrinkwrap file
|
||||||
@ -86,3 +101,20 @@
|
|||||||
when:
|
when:
|
||||||
- not yarn_lock.stat.exists
|
- not yarn_lock.stat.exists
|
||||||
- shrinkwrap_final.stat.exists
|
- shrinkwrap_final.stat.exists
|
||||||
|
|
||||||
|
- name: Check for built output
|
||||||
|
stat:
|
||||||
|
path: "{{ zuul_work_dir }}/{{ javascript_content_dir }}"
|
||||||
|
get_checksum: false
|
||||||
|
get_mime: false
|
||||||
|
get_md5: false
|
||||||
|
register: javascript_output
|
||||||
|
|
||||||
|
- name: Collect javascript output
|
||||||
|
synchronize:
|
||||||
|
src: "{{ zuul_work_dir }}/{{ javascript_content_dir }}/"
|
||||||
|
dest: "{{ log_path }}/html/"
|
||||||
|
mode: pull
|
||||||
|
copy_links: true
|
||||||
|
verify_host: true
|
||||||
|
when: javascript_output.stat.exists
|
||||||
|
53
zuul.yaml
53
zuul.yaml
@ -243,7 +243,7 @@
|
|||||||
Responds to these variables:
|
Responds to these variables:
|
||||||
|
|
||||||
.. zuul:jobvar:: npm_command
|
.. zuul:jobvar:: npm_command
|
||||||
:default: test
|
:default: build
|
||||||
|
|
||||||
Command to pass to npm.
|
Command to pass to npm.
|
||||||
|
|
||||||
@ -256,11 +256,16 @@
|
|||||||
:default: {{ zuul.project.src_dir }}
|
:default: {{ zuul.project.src_dir }}
|
||||||
|
|
||||||
Path to operate in.
|
Path to operate in.
|
||||||
|
|
||||||
|
.. zuul:jobvar: javascript_content_dir
|
||||||
|
:default: dist
|
||||||
|
|
||||||
|
Directory, relative to zuul_work_dir, holding build content.
|
||||||
pre-run: playbooks/javascript/pre.yaml
|
pre-run: playbooks/javascript/pre.yaml
|
||||||
run: playbooks/javascript/run.yaml
|
run: playbooks/javascript/run.yaml
|
||||||
post-run: playbooks/javascript/post.yaml
|
post-run: playbooks/javascript/post.yaml
|
||||||
vars:
|
vars:
|
||||||
npm_command: test
|
npm_command: build
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: build-javascript-tarball
|
name: build-javascript-tarball
|
||||||
@ -279,9 +284,43 @@
|
|||||||
:default: {{ zuul.project.src_dir }}
|
:default: {{ zuul.project.src_dir }}
|
||||||
|
|
||||||
Path to operate in.
|
Path to operate in.
|
||||||
|
|
||||||
|
.. zuul:jobvar: javascript_content_dir
|
||||||
|
:default: dist
|
||||||
|
|
||||||
|
Directory, relative to zuul_work_dir, holding build content.
|
||||||
vars:
|
vars:
|
||||||
npm_command: pack
|
npm_command: pack
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: build-javascript-content
|
||||||
|
parent: nodejs-npm
|
||||||
|
description: |
|
||||||
|
Build 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.
|
||||||
|
success-url: html/
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: nodejs-npm-run-test
|
name: nodejs-npm-run-test
|
||||||
description: |
|
description: |
|
||||||
@ -299,6 +338,11 @@
|
|||||||
:default: {{ zuul.project.src_dir }}
|
:default: {{ zuul.project.src_dir }}
|
||||||
|
|
||||||
Path to operate in.
|
Path to operate in.
|
||||||
|
|
||||||
|
.. zuul:jobvar: javascript_content_dir
|
||||||
|
:default: dist
|
||||||
|
|
||||||
|
Directory, relative to zuul_work_dir, holding build content.
|
||||||
pre-run: playbooks/javascript/pre-test.yaml
|
pre-run: playbooks/javascript/pre-test.yaml
|
||||||
run: playbooks/javascript/run.yaml
|
run: playbooks/javascript/run.yaml
|
||||||
post-run: playbooks/javascript/post.yaml
|
post-run: playbooks/javascript/post.yaml
|
||||||
@ -322,6 +366,11 @@
|
|||||||
:default: {{ zuul.project.src_dir }}
|
:default: {{ zuul.project.src_dir }}
|
||||||
|
|
||||||
Path to operate in.
|
Path to operate in.
|
||||||
|
|
||||||
|
.. zuul:jobvar: javascript_content_dir
|
||||||
|
:default: dist
|
||||||
|
|
||||||
|
Directory, relative to zuul_work_dir, holding build content.
|
||||||
vars:
|
vars:
|
||||||
npm_command: lint
|
npm_command: lint
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user