com.tikal.jenkins.plugins.multijob.PredefinedBuildParameters Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jenkins-multijob-plugin Show documentation
Show all versions of jenkins-multijob-plugin Show documentation
Enabling full hierarchy of Jenkins jobs
The newest version!
package com.tikal.jenkins.plugins.multijob;
import hudson.EnvVars;
import hudson.Extension;
import hudson.model.Action;
import hudson.model.Describable;
import hudson.model.ParameterValue;
import hudson.model.SimpleParameterDefinition;
import hudson.model.StringParameterValue;
import hudson.model.TaskListener;
import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
import hudson.model.Descriptor;
import hudson.model.Hudson;
import hudson.model.ParameterDefinition;
import hudson.model.ParametersAction;
import hudson.model.ParametersDefinitionProperty;
import java.io.IOException;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import org.apache.tools.ant.filters.StringInputStream;
import org.kohsuke.stapler.DataBoundConstructor;
public class PredefinedBuildParameters extends AbstractBuildParameters {
private String jobProperties;
@DataBoundConstructor
public PredefinedBuildParameters(String jobProperties) {
this.jobProperties = jobProperties;
}
public Action getAction(AbstractBuild,?> build, TaskListener listener, AbstractProject project)
throws IOException, InterruptedException {
EnvVars env = build.getEnvironment(listener);
// List actions = project.getActions();
// ParametersDefinitionProperty parameters=null;
// for (Object object : actions) {
// if(object instanceof hudson.model.ParametersDefinitionProperty)
// parameters = (ParametersDefinitionProperty)object;
//
// }
Properties pProp = new Properties();
pProp.load(new StringInputStream(jobProperties));
LinkedHashMap params = new LinkedHashMap();
// if (parameters !=null){
// boolean overwrite=false;
// for (ParameterDefinition parameterdef : parameters.getParameterDefinitions()) {
// params.put(parameterdef.getName(),parameterdef.getDefaultParameterValue());
for (Map.Entry
© 2015 - 2024 Weber Informatics LLC | Privacy Policy