Update javascript jobs to take npm_command variable

Similar to tox, the only difference in these is the command passed to
npm. Update the base job to do that, and the child jobs to use the
variable.

Change-Id: I5f9d420f1618e9a196b4218bca7055f377349351
This commit is contained in:
Monty Taylor 2017-12-11 11:35:30 -06:00
parent d3955a9d3f
commit b125b917d9
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
6 changed files with 40 additions and 29 deletions

View File

@ -1,4 +0,0 @@
- hosts: all
roles:
- role: npm
npm_command: docs

View File

@ -1,4 +0,0 @@
- hosts: all
roles:
- role: npm
npm_command: lint

View File

@ -1,4 +0,0 @@
- hosts: all
roles:
- role: npm
npm_command: test

View File

@ -0,0 +1,3 @@
- hosts: all
roles:
- npm

View File

@ -1,4 +0,0 @@
- hosts: all
roles:
- role: npm
npm_command: pack

View File

@ -231,12 +231,17 @@
pre-run: playbooks/multinode/pre.yaml
- job:
name: javascript-base
name: nodejs-npm
description: |
Base job for javascript operations
Responds to these variables:
.. zuul:jobvar:: npm_command
:default: test
Command to pass to npm.
.. zuul:jobvar:: node_version
:default: 6
@ -247,11 +252,14 @@
Path to operate in.
pre-run: playbooks/javascript/pre.yaml
run: playbooks/javascript/run.yaml
post-run: playbooks/javascript/post.yaml
vars:
npm_command: test
- job:
name: build-javascript-tarball
parent: javascript-base
parent: nodejs-npm
description: |
Build a source tarball for a Javascript project
@ -266,51 +274,67 @@
:default: {{ zuul.project.src_dir }}
Path to operate in.
run: playbooks/javascript/tarball.yaml
vars:
npm_command: pack
- job:
name: nodejs-npm-run-test
description: |
Run test using nodejs.
Responds to this variable:
Responds to these variables:
.. 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.
pre-run: playbooks/javascript/pre-test.yaml
run: playbooks/javascript/run-test.yaml
post-run: playbooks/javascript/post.yaml
- job:
name: nodejs-npm-run-lint
parent: javascript-base
parent: nodejs-npm
description: |
Run lint using nodejs.
Responds to this variable:
Responds to these variables:
.. zuul:jobvar:: node_version
:default: 6
The version of Node to use.
run: playbooks/javascript/run-lint.yaml
The version of Node to use.
.. zuul:jobvar: zuul_work_dir
:default: {{ zuul.project.src_dir }}
Path to operate in.
vars:
npm_command: lint
- job:
name: nodejs-npm-run-docs
parent: javascript-base
parent: nodejs-npm
description: |
Run docs using nodejs.
Responds to this variable:
Responds to these variables:
.. zuul:jobvar:: node_version
:default: 6
The version of Node to use.
run: playbooks/javascript/run-docs.yaml
The version of Node to use.
.. zuul:jobvar: zuul_work_dir
:default: {{ zuul.project.src_dir }}
Path to operate in.
post-run: playbooks/tox/docs-post.yaml
success-url: html/
vars:
npm_command: docs