Class CoreEnvironmentContributor
- java.lang.Object
-
- hudson.model.EnvironmentContributor
-
- jenkins.model.CoreEnvironmentContributor
-
- All Implemented Interfaces:
ExtensionPoint
@Extension(ordinal=-100.0) @Symbol("core") public class CoreEnvironmentContributor extends EnvironmentContributor
EnvironmentContributorthat adds the basic set of environment variables that we've been exposing historically.- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class hudson.model.EnvironmentContributor
EnvironmentContributor.EnvVarsHtml
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description CoreEnvironmentContributor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuildEnvironmentFor(Job j, EnvVars env, TaskListener listener)Contributes environment variables used for a job.voidbuildEnvironmentFor(Run r, EnvVars env, TaskListener listener)Contributes environment variables used for a build.-
Methods inherited from class hudson.model.EnvironmentContributor
all
-
-
-
-
Method Detail
-
buildEnvironmentFor
public void buildEnvironmentFor(Run r, EnvVars env, TaskListener listener) throws IOException, InterruptedException
Description copied from class:EnvironmentContributorContributes environment variables used for a build.This method can be called repeatedly for the same
Run, thus the computation of this method needs to be efficient. If you have a time-consuming computation, one strategy is to take the hit once and then add the result asInvisibleActiontoRun, then reuse those values later on.This method gets invoked concurrently for multiple
Runs 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(Job, EnvVars, TaskListener). This method only needs to add variables that are scoped to builds.- Overrides:
buildEnvironmentForin classEnvironmentContributor- Parameters:
r- Build that's being performed.env- 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
-
buildEnvironmentFor
public void buildEnvironmentFor(Job j, EnvVars env, TaskListener listener) throws IOException, InterruptedException
Description copied from class:EnvironmentContributorContributes environment variables used for a job.This method can be called repeatedly for the same
Job, thus the computation of this method needs to be efficient.This method gets invoked concurrently for multiple
Jobs, so it must be concurrent-safe.- Overrides:
buildEnvironmentForin classEnvironmentContributor- Parameters:
j- Job for which some activities are launched.env- 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
-
-