202cce830e
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
23 lines
651 B
ReStructuredText
23 lines
651 B
ReStructuredText
Install javascript dependencies needed for a project
|
|
|
|
**Role Variables**
|
|
|
|
.. zuul:rolevar:: 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:rolevar:: zuul_work_dir
|
|
:default: {{ zuul.project.src_dir }}
|
|
|
|
The directory to work in.
|
|
|
|
.. zuul:rolevar:: 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.
|