Class ConfigSubstitutionStep

java.lang.Object
hudson.model.AbstractDescribableImpl<org.jenkinsci.plugins.workflow.steps.Step>
org.jenkinsci.plugins.workflow.steps.Step
io.jenkins.plugins.configsplice.ConfigSubstitutionStep
All Implemented Interfaces:
ExtensionPoint, Describable<org.jenkinsci.plugins.workflow.steps.Step>

public class ConfigSubstitutionStep extends org.jenkinsci.plugins.workflow.steps.Step
The configSubstitution Pipeline step (SRS section 4).

 def result = configSubstitution(
     targets: [[files: ['**' + '/web.config'], format: 'xml',
                substitutions: [[path: 'appSettings.ApiUrl', value: 'https://production.com']]]]
 )
 echo "Changed ${result['filesChanged']} file(s)"
 

The step resolves credentials on the controller, where the Run context is available, then hands a fully resolved request to the agent that owns the workspace. It returns a value-free map of plain JDK collections so that a sandboxed Pipeline can read it without Script Approval.

  • Constructor Details

    • ConfigSubstitutionStep

      @DataBoundConstructor public ConfigSubstitutionStep(@NonNull 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)
    • start

      public org.jenkinsci.plugins.workflow.steps.StepExecution start(org.jenkinsci.plugins.workflow.steps.StepContext context)
      Specified by:
      start in class org.jenkinsci.plugins.workflow.steps.Step