Queue.Item item = ParameterizedJobMixIn.scheduleBuild2(job, 0, new CauseAction(new CLICause(Jenkins.getAuthentication().getName())), a); QueueTaskFuture<? extends Run<?,?>> f = item != null ? (QueueTaskFuture)item.getFuture() : null;
protected int run() throws Exception { job.checkPermission(Item.BUILD); ParametersAction a = null; if (!parameters.isEmpty()) { ParametersDefinitionProperty pdp = job.getProperty(ParametersDefinitionProperty.class); if (pdp==null) throw new AbortException(job.getFullDisplayName()+" is not parameterized but the -p option was specified"); List<ParameterValue> values = new ArrayList<ParameterValue>(); for (Entry<String, String> e : parameters.entrySet()) { String name = e.getKey(); ParameterDefinition pd = pdp.getParameterDefinition(name); if (pd==null) throw new AbortException(String.format("\'%s\' is not a valid parameter. Did you mean %s?", name, EditDistance.findNearest(name, pdp.getParameterDefinitionNames()))); values.add(pd.createValue(this,e.getValue())); } for (ParameterDefinition pd : pdp.getParameterDefinitions()) { if (parameters.get(pd.getName()) == null) { values.add(pd.getDefaultParameterValue()); } } a = new ParametersAction(values); } Future<? extends AbstractBuild> f = job.scheduleBuild2(0, new CLICause(), a); if (!sync) return 0; AbstractBuild b = f.get(); // wait for the completion stdout.println("Completed "+b.getFullDisplayName()+" : "+b.getResult()); return b.getResult().ordinal; }
protected int run() throws Exception { job.checkPermission(Item.BUILD); ParametersAction a = null; if (!parameters.isEmpty()) { ParametersDefinitionProperty pdp = job.getProperty(ParametersDefinitionProperty.class); if (pdp==null) throw new AbortException(job.getFullDisplayName()+" is not parameterized but the -p option was specified"); List<ParameterValue> values = new ArrayList<ParameterValue>(); for (Entry<String, String> e : parameters.entrySet()) { String name = e.getKey(); ParameterDefinition pd = pdp.getParameterDefinition(name); if (pd==null) throw new AbortException(String.format("\'%s\' is not a valid parameter. Did you mean %s?", name, EditDistance.findNearest(name, pdp.getParameterDefinitionNames()))); values.add(pd.createValue(this,e.getValue())); } for (ParameterDefinition pd : pdp.getParameterDefinitions()) { if (parameters.get(pd.getName()) == null) { values.add(pd.getDefaultParameterValue()); } } a = new ParametersAction(values); } Future<? extends AbstractBuild> f = job.scheduleBuild2(0, new CLICause(), a); if (!sync) return 0; AbstractBuild b = f.get(); // wait for the completion stdout.println("Completed "+b.getFullDisplayName()+" : "+b.getResult()); return b.getResult().ordinal; }
Queue.Item item = ParameterizedJobMixIn.scheduleBuild2(job, 0, new CauseAction(new CLICause(Jenkins.getAuthentication().getName())), a); QueueTaskFuture<? extends Run<?,?>> f = item != null ? (QueueTaskFuture)item.getFuture() : null;
Future<? extends AbstractBuild> f = job.scheduleBuild2(0, new CLICause(), a); if (!sync) { return 0;
protected int run() throws Exception { job.checkPermission(Item.BUILD); ParametersAction a = null; if (!parameters.isEmpty()) { ParametersDefinitionProperty pdp = job.getProperty(ParametersDefinitionProperty.class); if (pdp==null) throw new AbortException(job.getFullDisplayName()+" is not parameterized but the -p option was specified"); List<ParameterValue> values = new ArrayList<ParameterValue>(); for (Entry<String, String> e : parameters.entrySet()) { String name = e.getKey(); ParameterDefinition pd = pdp.getParameterDefinition(name); if (pd==null) throw new AbortException(String.format("\'%s\' is not a valid parameter. Did you mean %s?", name, EditDistance.findNearest(name, pdp.getParameterDefinitionNames()))); values.add(pd.createValue(this,e.getValue())); } for (ParameterDefinition pd : pdp.getParameterDefinitions()) { if (parameters.get(pd.getName()) == null) { values.add(pd.getDefaultParameterValue()); } } a = new ParametersAction(values); } Future<? extends AbstractBuild> f = job.scheduleBuild2(0, new CLICause(), a); if (!sync) return 0; AbstractBuild b = f.get(); // wait for the completion stdout.println("Completed "+b.getFullDisplayName()+" : "+b.getResult()); return b.getResult().ordinal; }