
We have a bunch of jobs that are built around the npm role, but for projects using yarn, that can lead to ignoring yarn.lock. For projects with a yarn.lock, we can assume the user wants to use yarn. Make a new js-package-manager role that can detect if that's the case and otherwise use npm. Make an js_build_tool parameter that allows the user to override that auto-detection. Make a whole new suite of jobs that do this behavior, do not have npm in their name, and default to the latest node LTS, version 14. Don't install yarn if we're not going to use yarn. Also allow people who want to use yarn but don't have a yarn.lock to override js_build_tool everywhere we do that logic. Mark the old jobs deprecated. Shift the npm and yarn roles to use the new js-package-manager role with defaults set. Change-Id: I8013228ca05607a69f390a9bb75991fc6543f865
415 lines
9.5 KiB
YAML
415 lines
9.5 KiB
YAML
# Jobs listed in js-jobs.rst.
|
|
|
|
- job:
|
|
name: js-build
|
|
parent: unittests
|
|
description: |
|
|
Base job for javascript operations
|
|
|
|
Responds to these variables:
|
|
|
|
.. zuul:jobvar:: js_build_command
|
|
:default: build
|
|
|
|
Command to pass to the javascript package manager..
|
|
|
|
.. zuul:jobvar:: js_build_tool
|
|
:default: autodetected
|
|
|
|
Command to use for running the package manager, such as npm or yarn.
|
|
|
|
.. zuul:jobvar:: node_version
|
|
:default: 14
|
|
|
|
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.
|
|
pre-run: playbooks/javascript/pre.yaml
|
|
run: playbooks/javascript/run.yaml
|
|
post-run: playbooks/javascript/post.yaml
|
|
vars:
|
|
js_build_command: build
|
|
|
|
- job:
|
|
name: build-javascript-source-tarball
|
|
parent: js-build
|
|
description: |
|
|
Build a source tarball for a Javascript project
|
|
|
|
Responds to these variables:
|
|
|
|
.. zuul:jobvar:: node_version
|
|
:default: 14
|
|
|
|
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.
|
|
vars:
|
|
js_build_command: pack
|
|
|
|
- job:
|
|
name: build-javascript-deployment
|
|
parent: js-build
|
|
description: |
|
|
Build javascript web content as it should be deployed.
|
|
|
|
Responds to these variables:
|
|
|
|
.. zuul:jobvar:: js_build_command
|
|
:default: build
|
|
|
|
Command to pass to npm.
|
|
|
|
.. zuul:jobvar:: node_version
|
|
:default: 14
|
|
|
|
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: npm/html/
|
|
|
|
- job:
|
|
name: build-javascript-deployment-tarball
|
|
parent: js-build
|
|
description: |
|
|
Build an archive of javascript web content as it should be deployed.
|
|
|
|
Responds to these variables:
|
|
|
|
.. zuul:jobvar:: js_build_command
|
|
:default: build
|
|
|
|
Command to pass to npm.
|
|
|
|
.. zuul:jobvar:: node_version
|
|
:default: 14
|
|
|
|
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.
|
|
|
|
.. zuul:jobvar:: create_tarball_directory
|
|
|
|
Create a tarball with the contents of
|
|
create_tarball_directory (relative to zuul_work_dir).
|
|
post-run: playbooks/javascript/tarball.yaml
|
|
|
|
- job:
|
|
name: nodejs-run-test
|
|
parent: js-build
|
|
description: |
|
|
Run test using nodejs. This test also starts Xvfb for run time
|
|
tests.
|
|
|
|
Responds to these variables:
|
|
|
|
.. zuul:jobvar:: node_version
|
|
:default: 14
|
|
|
|
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.
|
|
pre-run: playbooks/javascript/pre-test.yaml
|
|
vars:
|
|
js_build_command: test
|
|
|
|
- job:
|
|
name: nodejs-run-lint
|
|
parent: js-build
|
|
description: |
|
|
Run lint using nodejs.
|
|
|
|
Responds to these variables:
|
|
|
|
.. zuul:jobvar:: node_version
|
|
:default: 14
|
|
|
|
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.
|
|
vars:
|
|
js_build_command: lint
|
|
|
|
- job:
|
|
name: nodejs-run-docs
|
|
parent: js-build
|
|
description: |
|
|
Run docs using nodejs.
|
|
|
|
Responds to these variables:
|
|
|
|
.. zuul:jobvar:: node_version
|
|
:default: 14
|
|
|
|
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: docs/
|
|
vars:
|
|
js_build_command: docs
|
|
|
|
- job:
|
|
name: nodejs-npm
|
|
parent: unittests
|
|
description: |
|
|
Base job for javascript operations using npm.
|
|
** DEPRECATED: Switch to js-build **
|
|
|
|
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.
|
|
pre-run: playbooks/nodejs-npm/pre.yaml
|
|
run: playbooks/nodejs-npm/run.yaml
|
|
post-run: playbooks/javascript/post.yaml
|
|
vars:
|
|
npm_command: build
|
|
|
|
- job:
|
|
name: build-javascript-tarball
|
|
parent: nodejs-npm
|
|
description: |
|
|
Build a source tarball for a Javascript project
|
|
|
|
** DEPRECATED: Switch to build-javascript-source-tarball **
|
|
|
|
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.
|
|
|
|
.. zuul:jobvar:: javascript_content_dir
|
|
:default: dist
|
|
|
|
Directory, relative to zuul_work_dir, holding build content.
|
|
vars:
|
|
npm_command: pack
|
|
|
|
- job:
|
|
name: build-javascript-content
|
|
parent: nodejs-npm
|
|
description: |
|
|
Build javascript web content as it should be deployed.
|
|
|
|
** DEPRECATED: Please switch to build-javascript-release **
|
|
|
|
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: npm/html/
|
|
|
|
- job:
|
|
name: build-javascript-content-tarball
|
|
parent: nodejs-npm
|
|
description: |
|
|
Build an archive of javascript web content as it should be deployed.
|
|
|
|
** DEPRECATED: Please use build-javascript-deployment-tarball **
|
|
|
|
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.
|
|
|
|
.. zuul:jobvar:: create_tarball_directory
|
|
|
|
Create a tarball with the contents of
|
|
create_tarball_directory (relative to zuul_work_dir).
|
|
post-run: playbooks/javascript/tarball.yaml
|
|
|
|
- job:
|
|
name: nodejs-npm-run-test
|
|
parent: nodejs-npm
|
|
description: |
|
|
Run test using nodejs. This test also starts Xvfb for run time
|
|
tests.
|
|
|
|
** DEPRECATED: Please switch to nodejs-run-test **
|
|
|
|
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.
|
|
|
|
.. zuul:jobvar:: javascript_content_dir
|
|
:default: dist
|
|
|
|
Directory, relative to zuul_work_dir, holding build content.
|
|
pre-run: playbooks/javascript/pre-test.yaml
|
|
vars:
|
|
npm_command: test
|
|
|
|
- job:
|
|
name: nodejs-npm-run-lint
|
|
parent: nodejs-npm
|
|
description: |
|
|
Run lint using nodejs.
|
|
|
|
** DEPRECATED: Please switch to nodejs-run-lint **
|
|
|
|
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.
|
|
|
|
.. zuul:jobvar:: javascript_content_dir
|
|
:default: dist
|
|
|
|
Directory, relative to zuul_work_dir, holding build content.
|
|
vars:
|
|
npm_command: lint
|
|
|
|
- job:
|
|
name: nodejs-npm-run-docs
|
|
parent: nodejs-npm
|
|
description: |
|
|
Run docs using nodejs.
|
|
|
|
** DEPRECATED: Please switch to nodejs-run-docs **
|
|
|
|
Responds to these variables:
|
|
|
|
.. zuul:jobvar:: npm_executable
|
|
:default: autodetected
|
|
|
|
Command to use for running npm, such as npm or yarn.
|
|
|
|
.. 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.
|
|
post-run: playbooks/tox/docs-post.yaml
|
|
success-url: docs/
|
|
vars:
|
|
npm_command: docs
|