@DataBoundConstructor public StringSystemScriptSource(SecureGroovyScript script) { this.script = script.configuringWithNonKeyItem(); }
@DataBoundConstructor public GroovyCondition(final SecureGroovyScript script, final String unmetQualificationLabel, final String metQualificationLabel) { this.unmetQualificationLabel = Util.fixEmptyAndTrim(unmetQualificationLabel); this.metQualificationLabel = Util.fixEmptyAndTrim(metQualificationLabel); this.script = script.configuringWithNonKeyItem(); }
/** * Creates the job property definition. * @param propertiesFilePath Path to the property file to be injected * @param propertiesContent Property definition * @param scriptFilePath Path to the Shell/batch script file, which should be executed to retrieve the EnvVars * @param scriptContent Shell/batch script, which should be executed to retrieve the EnvVars * @param loadFilesFromMaster If {@code true}, the script file will be loaded from the master * @param secureGroovyScript Groovy script to be executed in order to produce the environment variables. * This script will be verified by the Script Security plugin if defined. */ @DataBoundConstructor public EnvInjectJobPropertyInfo( @CheckForNull String propertiesFilePath, @CheckForNull String propertiesContent, @CheckForNull String scriptFilePath, @CheckForNull String scriptContent, boolean loadFilesFromMaster, @CheckForNull SecureGroovyScript secureGroovyScript ) { super(propertiesFilePath, propertiesContent); this.scriptFilePath = Util.fixEmpty(scriptFilePath); this.scriptContent = fixCrLf(Util.fixEmpty(scriptContent)); this.secureGroovyScript = secureGroovyScript != null ? secureGroovyScript.configuringWithNonKeyItem() : null; this.loadFilesFromMaster = loadFilesFromMaster; }
public GroovyScriptExecutor(Script script, List<String> arguments, AbstractBuild<?, ?> build, Logger log) { this.arguments = new ArrayList<>(arguments); this.build = build; this.log = log; String enrichedScript = Util.replaceMacro(script.getContent(), EnvVars.masterEnvVars); secureGroovyScript = new SecureGroovyScript(enrichedScript, script.isSandboxed(), null); secureGroovyScript.configuringWithNonKeyItem(); }