npmExecute¶
Parameters¶
name | mandatory | default | possible values |
---|---|---|---|
defaultNpmRegistry |
no | ||
dockerEnvVars |
no | ||
dockerImage |
no | node:lts-buster |
|
dockerOptions |
no | ||
dockerWorkspace |
no | ||
npmCommand |
no | ||
script |
yes |
defaultNpmRegistry
- URL of default NPM registrydockerEnvVars
- Environment variables to set in the container, e.g. [http_proxy: 'proxy:8080'].dockerImage
- Name of the docker image that should be used, in which node should be installed and configured.dockerOptions
- Docker options to be set when starting the container.dockerWorkspace
- Kubernetes only: Specifies a dedicated user home directory for the container which will be passed as value for environment variableHOME
.npmCommand
- Which NPM command should be executed.script
- The common script environment of the Jenkinsfile running. Typically the reference to the script calling the pipeline step is provided with thethis
parameter, as inscript: this
. This allows the function to access thecommonPipelineEnvironment
for retrieving, e.g. configuration parameters.
Step configuration¶
We recommend to define values of step parameters via config.yml file.
In following sections of the config.yml the configuration is possible:
parameter | general | step/stage |
---|---|---|
defaultNpmRegistry |
X | |
dockerEnvVars |
X | |
dockerImage |
X | |
dockerOptions |
X | |
dockerWorkspace |
X | |
npmCommand |
X | |
script |
Dependencies¶
The step depends on the following Jenkins plugins
- docker
- kubernetes
- pipeline-utility-steps
- workflow-basic-steps
- workflow-cps-global-lib
- workflow-durable-task-step
The kubernetes plugin is only used if running in a kubernetes environment. Transitive dependencies are omitted.
The list might be incomplete.
Consider using the ppiper/jenkins-master docker image. This images comes with preinstalled plugins.
Exceptions¶
None
Examples¶
npmExecute script: this, dockerImage: 'node:8-stretch', npmCommand: 'run build'