Package com.lookout.jenkins
Class EnvironmentScript
java.lang.Object
hudson.model.AbstractDescribableImpl<BuildWrapper>
hudson.tasks.BuildWrapper
com.lookout.jenkins.EnvironmentScript
- All Implemented Interfaces:
ExtensionPoint,hudson.matrix.MatrixAggregatable,Describable<BuildWrapper>
Runs a specific chunk of code before each build, parsing output for new
environment variables.
- Author:
- Jørgen P. Tjernø, dawidmalina@gmail.com
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class hudson.tasks.BuildWrapper
BuildWrapper.EnvironmentNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
ConstructorsConstructorDescriptionEnvironmentScript(String script, String scriptType, boolean runOnlyOnParent, boolean hideEnvironmentVariablesValues) -
Method Summary
Modifier and TypeMethodDescriptionString[]buildCommandLine(FilePath scriptFile) hudson.matrix.MatrixAggregatorcreateAggregator(hudson.matrix.MatrixBuild build, Launcher launcher, BuildListener listener) Create an aggregator that will calculate the environment once if onlyRunOnParent is true.We'll use this from the "config.jelly".We will use this from the "config.jelly".booleanbooleansetUp(AbstractBuild build, Launcher launcher, BuildListener listener) Methods inherited from class hudson.tasks.BuildWrapper
all, decorateLauncher, decorateLogger, getProjectAction, getProjectActions, makeBuildVariables, makeSensitiveBuildVariables, preCheckout, setUp
-
Constructor Details
-
EnvironmentScript
-
-
Method Details
-
getScript
We'll use this from the "config.jelly". -
getScriptType
We will use this from the "config.jelly".- Returns:
-
isRunOnlyOnParent
public boolean isRunOnlyOnParent()- Returns:
- Whether or not we only run this on the
MatrixBuildparent, or on the individualMatrixRuns.
-
isHideEnvironmentVariablesValues
public boolean isHideEnvironmentVariablesValues() -
setUp
public BuildWrapper.Environment setUp(AbstractBuild build, Launcher launcher, BuildListener listener) throws IOException, InterruptedException - Overrides:
setUpin classBuildWrapper- Throws:
IOExceptionInterruptedException
-
buildCommandLine
-
createAggregator
public hudson.matrix.MatrixAggregator createAggregator(hudson.matrix.MatrixBuild build, Launcher launcher, BuildListener listener) Create an aggregator that will calculate the environment once if onlyRunOnParent is true. The aggregator we return is called on the parent job for matrix jobs. In it we generate the environment once and persist it in an Action (of typePersistedEnvironment) if the job has onlyRunOnParent enabled. The subjobs ("configuration runs") will retrieve this and apply it to their environment, without performing the calculation.- Specified by:
createAggregatorin interfacehudson.matrix.MatrixAggregatable
-
getDescriptor
- Specified by:
getDescriptorin interfaceDescribable<BuildWrapper>- Overrides:
getDescriptorin classAbstractDescribableImpl<BuildWrapper>
-