From 91d1126097525730d3394c37ca76819b5e1ec910 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Thu, 21 Dec 2017 12:02:04 -0600 Subject: [PATCH] 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 --- playbooks/tox/npm.yaml | 5 ++++ zuul.yaml | 60 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 playbooks/tox/npm.yaml diff --git a/playbooks/tox/npm.yaml b/playbooks/tox/npm.yaml new file mode 100644 index 000000000..c3bbf6355 --- /dev/null +++ b/playbooks/tox/npm.yaml @@ -0,0 +1,5 @@ +- hosts: all + roles: + - revoke-sudo + - npm + - tox diff --git a/zuul.yaml b/zuul.yaml index 928b82aff..bc89aa0ef 100644 --- a/zuul.yaml +++ b/zuul.yaml @@ -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: |