Class ConfigSubstitutionBuilder

java.lang.Object
hudson.tasks.BuildStepCompatibilityLayer
hudson.tasks.Builder
io.jenkins.plugins.configsplice.ConfigSubstitutionBuilder
All Implemented Interfaces:
ExtensionPoint, Describable<Builder>, BuildStep, SimpleBuildStep

public class ConfigSubstitutionBuilder extends Builder implements SimpleBuildStep
The Freestyle build step (SRS section 4.7).

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.

  • Constructor Details

    • ConfigSubstitutionBuilder

      @DataBoundConstructor public ConfigSubstitutionBuilder(@CheckForNull List<TargetGroup> targets)
  • Method Details

    • getTargets

      @NonNull public List<TargetGroup> getTargets()
    • isDryRun

      public boolean isDryRun()
    • setDryRun

      @DataBoundSetter public void setDryRun(boolean dryRun)
    • getNoMatchBehavior

      @NonNull public String getNoMatchBehavior()
    • setNoMatchBehavior

      @DataBoundSetter public void setNoMatchBehavior(@CheckForNull String noMatchBehavior)
    • getMissingPathBehavior

      @NonNull public String getMissingPathBehavior()
    • setMissingPathBehavior

      @DataBoundSetter public void setMissingPathBehavior(@CheckForNull String missingPathBehavior)
    • 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, IOException
      Runs the substitution against the build's workspace.

      Failures reach the log as a message and nothing else. Agent-side failures already arrive as an AbortException from SubstitutionCallable, which is why they need no handling here; this catch covers the controller-side half — validation and credential resolution — where a SpliceException is 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:
      perform in interface SimpleBuildStep
      Throws:
      InterruptedException
      IOException