Node JSBuild Step
A Node.js build step
Example. Adds a Node.js build step with specified script commands, that will be running in Node.js LTS Docker container.
buildType {
// Other Build Type settings ...
steps {
// Other Build Steps ...
nodeJS {
name = "Node.js test"
shellScript = """
npm ci
npm run test
""".trimIndent()
}
Content copied to clipboard }
}Example. Adds a Node.js build step with specified script commands, that will be running in specified Node.js Docker container, in custom working directory. This build step will run even if some previous build steps are failed.
buildType {
// Other Build Type settings ...
steps {
// Other Build Steps ...
nodeJS {
name = "Node.js test"
executionMode = BuildStep.ExecutionMode.RUN_ON_FAILURE
workingDir = "frontend"
shellScript = """
npm ci
npm run test
""".trimIndent()
dockerImage = "node:18"
}
Content copied to clipboard }
}See also
Types
Properties
Optional collection of build step execution conditions
Specifies which Docker image to use for running this build step. I.e. the build step will be run inside specified docker image, using 'docker run' wrapper.
Specifies which Docker image platform will be used to run this build step.
If enabled, "docker pull image" will be run before docker run.
Additional docker run command arguments
Build step execution mode
Specifies which pull policy will be used with the specified image at each pod's execution.
Shell commands for running Node.js projects
Build working directory for commands run, specify it if it is different from the checkout directory.
Functions
Deletes all configured build step conditions
Configures build step conditions
Copies parameters of this object to the specified target
A list of records, each field of an item stored as a parameter of its own: parameter f of the n-th item, counting from 1, is stored as name.n.f. A script fills the list in the block of the parameter, see RecordList.
A record, each field stored as a parameter of its own: parameter f of the record is stored as name.f. A script fills the record in the block of the parameter; a record without parameters stores nothing.
Validates this object and reports found errors to the provided consumer