Package jenkins.plugins.nodejs
Class NodeJSCommandInterpreter
java.lang.Object
hudson.tasks.BuildStepCompatibilityLayer
hudson.tasks.Builder
hudson.tasks.CommandInterpreter
jenkins.plugins.nodejs.NodeJSCommandInterpreter
- All Implemented Interfaces:
ExtensionPoint
,Describable<Builder>
,BuildStep
,EnvVarsFilterableBuilder
This class executes a JavaScript file using node. The file should contain
NodeJS script specified in the job configuration.
- Author:
- cliffano, Nikolas Falco
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Provides builder details for the job configuration page.Nested classes/interfaces inherited from interface hudson.tasks.BuildStep
BuildStep.PublisherList
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
Fields inherited from class hudson.tasks.CommandInterpreter
command, configuredLocalRules
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
-
Constructor Summary
ConstructorDescriptionNodeJSCommandInterpreter
(String command, String nodeJSInstallationName) Constructs aNodeJSCommandInterpreter
with specified command.NodeJSCommandInterpreter
(String command, String nodeJSInstallationName, String configId) Constructs aNodeJSCommandInterpreter
with specified command. -
Method Summary
Modifier and TypeMethodDescriptionString[]
buildCommandLine
(FilePath script) protected String
protected String
Gets the NodeJS to invoke, or null to invoke the default one.protected boolean
internalPerform
(AbstractBuild<?, ?> build, Launcher launcher, TaskListener listener) boolean
perform
(AbstractBuild<?, ?> build, Launcher launcher, TaskListener listener) void
setCacheLocationStrategy
(CacheLocationLocator cacheLocationStrategy) void
setConfigId
(String configId) Methods inherited from class hudson.tasks.CommandInterpreter
buildEnvVarsFilterRules, createScriptFile, getCommand, getConfiguredLocalRules, isErrorlevelForUnstableBuild, join, perform
Methods inherited from class hudson.tasks.Builder
all, getDescriptor, getRequiredMonitorService, prebuild
Methods inherited from class hudson.tasks.BuildStepCompatibilityLayer
getProjectAction, getProjectAction, getProjectActions, perform, prebuild
-
Constructor Details
-
NodeJSCommandInterpreter
@DataBoundConstructor public NodeJSCommandInterpreter(String command, String nodeJSInstallationName) Constructs aNodeJSCommandInterpreter
with specified command.- Parameters:
command
- the NodeJS scriptnodeJSInstallationName
- the NodeJS label configured in Jenkins
-
NodeJSCommandInterpreter
Constructs aNodeJSCommandInterpreter
with specified command.- Parameters:
command
- the NodeJS scriptnodeJSInstallationName
- the NodeJS label configured in JenkinsconfigId
- the provided Config id
-
-
Method Details
-
getNodeJS
Gets the NodeJS to invoke, or null to invoke the default one.- Returns:
- a NodeJS installation setup for this job,
null
otherwise.
-
perform
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, TaskListener listener) throws InterruptedException- Overrides:
perform
in classCommandInterpreter
- Throws:
InterruptedException
-
internalPerform
protected boolean internalPerform(AbstractBuild<?, ?> build, Launcher launcher, TaskListener listener) throws InterruptedException- Throws:
InterruptedException
-
buildCommandLine
- Specified by:
buildCommandLine
in classCommandInterpreter
-
getContents
- Specified by:
getContents
in classCommandInterpreter
-
getFileExtension
- Specified by:
getFileExtension
in classCommandInterpreter
-
getNodeJSInstallationName
-
getConfigId
-
setConfigId
-
getCacheLocationStrategy
-
setCacheLocationStrategy
-