Add tox-nodejs-npm base job for python and javascript

Sometimes projects are multi-language. Specifically, sometimes they need
to run both javascript and python toolchains. Support this by making a
tox-nodejs-npm job which installs both toolchains, then runs the npm
command followed by the tox command.

Most people won't need/want this, but it should make at least some folks
happy.

Change-Id: Iaedd680a548c6e8159693b7a79cd8676e805aa1f
This commit is contained in:
Monty Taylor 2017-12-21 12:02:04 -06:00
parent 6d8d1a4408
commit 91d1126097
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
2 changed files with 65 additions and 0 deletions

5
playbooks/tox/npm.yaml Normal file
View File

@ -0,0 +1,5 @@
- hosts: all
roles:
- revoke-sudo
- npm
- tox

View File

@ -137,6 +137,66 @@
vars:
tox_envlist: bashate
- job:
name: tox-nodejs-npm
parent: tox
description: |
Run tests using tox but with the javascript toolchain installed
and available as well. A combination of the tox and nodejs-npm
jobs. By default will run npm before running the tox environment listed.
Responds to these variables:
.. zuul:jobvar:: tox_envlist
Use the specified tox environments (``ALL`` selects all).
.. zuul:jobvar:: tox_environment
List of user defined environmental variables to pass to bash
shell.
.. zuul:jobvar:: tox_extra_args
String containing extra arguments to append to the tox command line.
.. zuul:jobvar: tox_constraints_file
Path to a pip constraints file. Will be provided to tox in the
UPPER_CONSTRAINTS_FILE environment variable if it exists.
.. zuul:jobvar: tox_install_siblings
:default: true
Override tox requirements that have corresponding zuul git repos
on the node by installing the git versions into the tox virtualenv.
.. 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: javascript_content_dir
:default: dist
Directory, relative to zuul_work_dir, holding build content.
.. zuul:jobvar: zuul_work_dir
:default: {{ zuul.project.src_dir }}
Path to operate in.
pre-run: playbooks/javascript/pre.yaml
run: playbooks/tox/npm.yaml
post-run: playbooks/javascript/post.yaml
vars:
npm_command: build
- job:
name: build-python-release
description: |