Javascript Roles

ensure-javascript-build-tool

Install javascript build tool needed for a project

Role Variables

js_build_tool
Default: autodetected

What command to use. If the zuul_work_dir has a yarn.lock file, it will default to yarn, otherwise npm.

zuul_work_dir
Default: {{ zuul.project.src_dir }}

The directory to work in.

ensure-javascript-packages

Install javascript dependencies needed for a project

Role Variables

js_build_tool
Default: autodetected

What command to use. If the zuul_work_dir has a yarn.lock file it will default to yarn, otherwise npm.

zuul_work_dir
Default: {{ zuul.project.src_dir }}

The directory to work in.

tox_constraints_file

Path to a pip constraints file. Will be provided to via TOX_CONSTRAINTS_FILE (deprecated but currently still supported name is UPPER_CONSTRAINTS_FILE) environment variable if it exists. Useful if npm postinstall runs tox.

ensure-nodejs

Install NodeJS from nodesource

Role Variables

node_version

Required. What version of Node to install.

ensure-yarn

Install yarn from yarnpkg repos.

This role use the role ensure-nodejs to ensure that NodeJS is installed. See the documentation for ensure-nodejs and specify the version of NodeJS to install.

fetch-javascript-content-tarball

Fetch a Javascript content tarball back to be published.

A content tarball is one that contains built javascript/css artifacts, such as but not limited to those produced by the webpack ArchivePlugin.

Role Variables

zuul_work_dir
Default: {{ zuul.project.src_dir }}

Directory to work in.

create_tarball_directory

Create a tarball with the contents of create_tarball_directory (relative to zuul_work_dir).

fetch-javascript-output

Collect outputs from a javascript build

Role Variables

zuul_work_dir
Default: {{ zuul.project.src_dir }}

Directory to work in

javascript_content_dir
Default: dist

Directory, relative to zuul_work_dir, in which javascript output content is to be found.

Whether to copy the data pointed to by symlinks in the built content, or to copy them as symbolic links.

fetch-javascript-tarball

Fetch a Javascript tarball back to be published.

Role Variables

zuul_work_dir
Default: {{ zuul.project.src_dir }}

Directory to run npm in.

zuul_use_fetch_output
Default: false

Whether to synchronize files to the executor work dir, or to copy them on the test instance. When set to false, the role synchronizes the file to the executor. When set to true, the job needs to use the fetch-output role later.

js-package-manager

Run javascript build command in a source directory. Assumes the appropriate version of npm or yarn has been installed.

Role Variables

js_build_tool
Default: autodetected

What command to use. If the zuul_work_dir has a yarn.lock file it will default to yarn, otherwise npm.

js_build_command

Command to run. If it’s a standard lifecycle command, it will be run as {{ js_build_tool }} {{ js_build_command }}. Otherwise it will be run as {{ js_build_tool }} run {{ js_build_command }}.

zuul_work_dir
Default: {{ zuul.project.src_dir }}

Directory to run in.

netlify-publish

Publish built site to netlify

Role Variables

netlify_site_id

Site id for the site to publish. This can be found on the site general settings page as API Id.

netlify_auth

Complex argument which contains the netlify authentication credentials. This is expected to come from a secret.

netlify_auth.token

API token to use to publish the content. Instructions for creating a token can be found at https://docs.netlify.com/cli/get-started/#obtain-a-token-in-the-netlify-ui

zuul_work_dir
Default: {{ zuul.project.src_dir }}

The project directory.

nodejs-test-dependencies

Install test dependencies for Node

npm

Run npm command in a source directory. Assumes the appropriate version of npm has been installed.

Role Variables

npm_command

Command to run. If it’s a standard npm lifecycle command, it will be run as npm {{ npm_command }}. Otherwise it will be run as npm run {{ npm_command }}.

zuul_work_dir
Default: {{ zuul.project.src_dir }}

Directory to run npm in.

upload-npm

Upload javascript packages to npm

Role Variables

npm_credentials

Complex argument which contains the information about the npm server as well as the authentication information needed. It is expected that this argument comes from a Secret. This role expects to be run on the executor.

npm_credentials.username

Username to use to log in to npm.

npm_credentials.password

Password to use to log in to npm.

npm_credentials.authToken

An auth token (issued from the npm server) to authenticate with. This is required if you are using two-factor authentication. If specifying an authToken you should not specify `username and password.

npm_credentials.email

Email associated with the npm account.

npm_credentials.author_name

npm author name.

npm_credentials.author_url

npm author url.

npm_credentials.author_email

npm author email.

npm_credentials.registry_url
Default: //registry.npmjs.org

URL of npm registry server.

yarn

Run yarn command in a source directory. Assumes the appropriate version of yarn has been installed.

Role Variables

yarn_command

Command to run. If it’s a standard lifecycle command, it will be run as yarn {{ yarn_command }}. Otherwise it will be run as yarn run {{ yarn_command }}.

zuul_work_dir
Default: {{ zuul.project.src_dir }}

Directory to run yarn in.