From b125b917d98d19e68ecafb26b466af431c6539d6 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Mon, 11 Dec 2017 11:35:30 -0600 Subject: [PATCH] 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 --- playbooks/javascript/run-docs.yaml | 4 --- playbooks/javascript/run-lint.yaml | 4 --- playbooks/javascript/run-test.yaml | 4 --- playbooks/javascript/run.yaml | 3 ++ playbooks/javascript/tarball.yaml | 4 --- zuul.yaml | 50 ++++++++++++++++++++++-------- 6 files changed, 40 insertions(+), 29 deletions(-) delete mode 100644 playbooks/javascript/run-docs.yaml delete mode 100644 playbooks/javascript/run-lint.yaml delete mode 100644 playbooks/javascript/run-test.yaml create mode 100644 playbooks/javascript/run.yaml delete mode 100644 playbooks/javascript/tarball.yaml diff --git a/playbooks/javascript/run-docs.yaml b/playbooks/javascript/run-docs.yaml deleted file mode 100644 index 5078a587c..000000000 --- a/playbooks/javascript/run-docs.yaml +++ /dev/null @@ -1,4 +0,0 @@ -- hosts: all - roles: - - role: npm - npm_command: docs diff --git a/playbooks/javascript/run-lint.yaml b/playbooks/javascript/run-lint.yaml deleted file mode 100644 index 0fbd82caa..000000000 --- a/playbooks/javascript/run-lint.yaml +++ /dev/null @@ -1,4 +0,0 @@ -- hosts: all - roles: - - role: npm - npm_command: lint diff --git a/playbooks/javascript/run-test.yaml b/playbooks/javascript/run-test.yaml deleted file mode 100644 index e7cc37c49..000000000 --- a/playbooks/javascript/run-test.yaml +++ /dev/null @@ -1,4 +0,0 @@ -- hosts: all - roles: - - role: npm - npm_command: test diff --git a/playbooks/javascript/run.yaml b/playbooks/javascript/run.yaml new file mode 100644 index 000000000..008c062e7 --- /dev/null +++ b/playbooks/javascript/run.yaml @@ -0,0 +1,3 @@ +- hosts: all + roles: + - npm diff --git a/playbooks/javascript/tarball.yaml b/playbooks/javascript/tarball.yaml deleted file mode 100644 index 79c3f872d..000000000 --- a/playbooks/javascript/tarball.yaml +++ /dev/null @@ -1,4 +0,0 @@ -- hosts: all - roles: - - role: npm - npm_command: pack diff --git a/zuul.yaml b/zuul.yaml index 8687534a6..dc0bad549 100644 --- a/zuul.yaml +++ b/zuul.yaml @@ -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