Class StepEnvironmentContributor
java.lang.Object
org.jenkinsci.plugins.workflow.steps.StepEnvironmentContributor
- All Implemented Interfaces:
ExtensionPoint
Contributes environment variables to workflow steps.
This extension point can be used to externally add environment variables per workflow step.
- Since:
- XXX
- Author:
- Thomas Weißschuh, Amadeus Germany GmbH
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbuildEnvironmentFor(StepContext stepContext, EnvVars envs, TaskListener listener) Contributes environment variables used for a workflow step.
-
Constructor Details
-
StepEnvironmentContributor
public StepEnvironmentContributor()
-
-
Method Details
-
buildEnvironmentFor
public void buildEnvironmentFor(@NonNull StepContext stepContext, @NonNull EnvVars envs, @NonNull TaskListener listener) throws IOException, InterruptedException Contributes environment variables used for a workflow step.This method can be called repeatedly for the same
Step, thus the computation of this method needs to be efficient.This method gets invoked concurrently for multiple
Steps that are being built at the same time, so it must be concurrent-safe.When building environment variables for a build, Jenkins will also invoke
EnvironmentContributor.buildEnvironmentFor(hudson.model.Run, EnvVars, TaskListener)andEnvironmentContributor.buildEnvironmentFor(hudson.model.Job, EnvVars, TaskListener)This method only needs to add variables that are scoped to a workflow step.- Parameters:
stepContext- Context of step that's being executedenvs- Partially built environment variable map. Implementation of this method is expected to add additional variables here.listener- Connected to the build console. Can be used to report errors.- Throws:
IOExceptionInterruptedException
-