Class EnvironmentScript

  • All Implemented Interfaces:
    ExtensionPoint, hudson.matrix.MatrixAggregatable, Describable<BuildWrapper>

    public class EnvironmentScript
    extends BuildWrapper
    implements hudson.matrix.MatrixAggregatable
    Runs a specific chunk of code before each build, parsing output for new environment variables.
    Jørgen P. Tjernø,
    • Constructor Detail

      • EnvironmentScript

        public EnvironmentScript​(String script,
                                 String scriptType,
                                 boolean runOnlyOnParent,
                                 boolean hideEnvironmentVariablesValues)
    • Method Detail

      • getScript

        public String getScript()
        We'll use this from the "config.jelly".
      • getScriptType

        public String getScriptType()
        We will use this from the "config.jelly".
      • isRunOnlyOnParent

        public boolean isRunOnlyOnParent()
        Whether or not we only run this on the MatrixBuild parent, or on the individual MatrixRun s.
      • isHideEnvironmentVariablesValues

        public boolean isHideEnvironmentVariablesValues()
      • buildCommandLine

        public String[] buildCommandLine​(FilePath scriptFile)
      • createAggregator

        public hudson.matrix.MatrixAggregator createAggregator​(hudson.matrix.MatrixBuild build,
                                                               Launcher launcher,
                                                               BuildListener listener)
        Create an aggregator that will calculate the environment once if onlyRunOnParent is true. The aggregator we return is called on the parent job for matrix jobs. In it we generate the environment once and persist it in an Action (of type PersistedEnvironment) if the job has onlyRunOnParent enabled. The subjobs ("configuration runs") will retrieve this and apply it to their environment, without performing the calculation.
        Specified by:
        createAggregator in interface hudson.matrix.MatrixAggregatable