NodeJSBuildStep
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
Constructors
Types
Functions
Deletes all configured build step conditions
Configures build step conditions
Copies parameters of this object to the specified target
Creates an instance of this build step via reflection using a no argument constructor, used during copying. Throws an error if this class doesn't have a default constructor. Subclasses can override it to create an instance without using a default constructor.
Validates this object and reports found errors to the provided consumer
Properties
If enabled, "pull image" command will be run before docker run.
Build working directory for commands run, specify it if it is different from the checkout directory.