Class ConfigSubstitutionBuilder
- All Implemented Interfaces:
ExtensionPoint,Describable<Builder>,BuildStep,SimpleBuildStep
An adapter, not a second implementation: it binds the same TargetGroups from a form
instead of from a Groovy map, then hands them to SubstitutionRunner, which is the same code
the Pipeline step runs. Anything that changes about validation, credential resolution or logging
changes for both surfaces at once, because there is only one copy of it.
Deliberately carries no @Symbol. Pipeline users have configSubstitution,
which returns the result map; this class cannot return anything, because
SimpleBuildStep.perform(hudson.model.Run<?, ?>, hudson.FilePath, hudson.Launcher, hudson.model.TaskListener) is void. Publishing a symbol would offer Pipeline a second
entry point that silently lacks the return value the README tells people to read, so it is not
offered. The legacy step([$class: 'ConfigSubstitutionBuilder', ...]) form still reaches it,
which is unavoidable for a SimpleBuildStep and obscure enough not to mislead.
Freestyle discards the result map. The counts still reach the user through the summary line the runner logs, which is the only channel a Freestyle job has.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface hudson.tasks.BuildStep
BuildStep.PublisherListNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudsonNested classes/interfaces inherited from interface jenkins.tasks.SimpleBuildStep
SimpleBuildStep.LastBuildAction, SimpleBuildStep.LastBuildActionFactory -
Field Summary
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanisDryRun()voidRuns the substitution against the build's workspace.voidsetAcknowledgeSecretLifecycle(boolean acknowledgeSecretLifecycle) voidsetDryRun(boolean dryRun) voidsetMissingPathBehavior(String missingPathBehavior) voidsetNoMatchBehavior(String noMatchBehavior) Methods inherited from class hudson.tasks.Builder
all, getDescriptor, getRequiredMonitorService, prebuildMethods inherited from class hudson.tasks.BuildStepCompatibilityLayer
getProjectAction, getProjectAction, getProjectActions, perform, perform, prebuildMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface hudson.tasks.BuildStep
getProjectAction, getProjectActions, getRequiredMonitorService, perform, prebuildMethods inherited from interface jenkins.tasks.SimpleBuildStep
perform, perform, requiresWorkspace
-
Constructor Details
-
ConfigSubstitutionBuilder
-
-
Method Details
-
getTargets
-
isDryRun
public boolean isDryRun() -
setDryRun
@DataBoundSetter public void setDryRun(boolean dryRun) -
getNoMatchBehavior
-
setNoMatchBehavior
-
getMissingPathBehavior
-
setMissingPathBehavior
-
isAcknowledgeSecretLifecycle
public boolean isAcknowledgeSecretLifecycle() -
setAcknowledgeSecretLifecycle
@DataBoundSetter public void setAcknowledgeSecretLifecycle(boolean acknowledgeSecretLifecycle) -
perform
public void perform(@NonNull Run<?, ?> run, @NonNull FilePath workspace, @NonNull EnvVars env, @NonNull Launcher launcher, @NonNull TaskListener listener) throws InterruptedException, IOExceptionRuns the substitution against the build's workspace.Failures reach the log as a message and nothing else. Agent-side failures already arrive as an
AbortExceptionfromSubstitutionCallable, which is why they need no handling here; this catch covers the controller-side half — validation and credential resolution — where aSpliceExceptionis still in flight and would otherwise print a stack trace. A stack trace is both noise and a place where a cause chain could surface something the message deliberately withholds.- Specified by:
performin interfaceSimpleBuildStep- Throws:
InterruptedExceptionIOException
-