/** * Adds a new {@link BuildStep} to this {@link Project} and saves the configuration. * * @deprecated as of 1.290 * Use {@code getPublishersList().add(x)} */ @Deprecated public void addPublisher(Publisher buildStep) throws IOException { getPublishersList().add(buildStep); }
/** * Default value for {@link ToolInstallation#getProperties()} used in the form binding. * @since 1.305 */ public DescribableList<ToolProperty<?>,ToolPropertyDescriptor> getDefaultProperties() throws IOException { DescribableList<ToolProperty<?>,ToolPropertyDescriptor> r = new DescribableList<ToolProperty<?>, ToolPropertyDescriptor>(NOOP); List<? extends ToolInstaller> installers = getDefaultInstallers(); if(!installers.isEmpty()) r.add(new InstallSourceProperty(installers)); return r; }
if (trigger != null) { if (trigger.addCiMessage) { project.getPublishersList().add(new GitLabCommitStatusPublisher("jenkins", false)); if (trigger != null) { if (trigger.addNoteOnMergeRequest) { project.getPublishersList().add(new GitLabMessagePublisher()); project.getPublishersList().add(new GitLabVotePublisher()); project.getPublishersList().add(new GitLabAcceptMergeRequestPublisher());
/** * Accepts submission from the configuration page. */ @RequirePOST public synchronized HttpResponse doConfigSubmit( StaplerRequest req) throws IOException, ServletException, FormException { BulkChange bc = new BulkChange(MONITORS_OWNER); try { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); monitors.rebuild(req,req.getSubmittedForm(),getNodeMonitorDescriptors()); // add in the rest of instances are ignored instances for (Descriptor<NodeMonitor> d : NodeMonitor.all()) if(monitors.get(d)==null) { NodeMonitor i = createDefaultInstance(d, true); if(i!=null) monitors.add(i); } // recompute the data for (NodeMonitor nm : monitors) { nm.triggerUpdate(); } return FormApply.success("."); } finally { bc.commit(); } }
/** * Adds a new {@link BuildStep} to this {@link Project} and saves the configuration. * * @deprecated as of 1.290 * Use {@code getPublishersList().add(x)} */ @Deprecated public void addPublisher(Publisher buildStep) throws IOException { getPublishersList().add(buildStep); }
@SuppressWarnings("rawtypes") // else setOwner will not compile public void addProperty(AbstractFolderProperty p) throws IOException { if (!p.getDescriptor().isApplicable(getClass())) { throw new IllegalArgumentException(p.getClass().getName() + " cannot be applied to " + getClass().getName()); } p.setOwner(this); properties.add(p); }
protected void addIfMissing(GhprbExtension ext) { if (getExtensions().get(ext.getClass()) == null) { getExtensions().add(ext); } }
private void addIfMissing(GhprbExtension ext) { if (getExtensions().get(ext.getClass()) == null) { getExtensions().add(ext); } } }
/** * Default value for {@link ToolInstallation#getProperties()} used in the form binding. * @since 1.305 */ public DescribableList<ToolProperty<?>,ToolPropertyDescriptor> getDefaultProperties() throws IOException { DescribableList<ToolProperty<?>,ToolPropertyDescriptor> r = new DescribableList<ToolProperty<?>, ToolPropertyDescriptor>(NOOP); List<? extends ToolInstaller> installers = getDefaultInstallers(); if(!installers.isEmpty()) r.add(new InstallSourceProperty(installers)); return r; }
/** * Default value for {@link ToolInstallation#getProperties()} used in the form binding. * @since 1.305 */ public DescribableList<ToolProperty<?>,ToolPropertyDescriptor> getDefaultProperties() throws IOException { DescribableList<ToolProperty<?>,ToolPropertyDescriptor> r = new DescribableList<ToolProperty<?>, ToolPropertyDescriptor>(NOOP); List<? extends ToolInstaller> installers = getDefaultInstallers(); if(!installers.isEmpty()) r.add(new InstallSourceProperty(installers)); return r; }
public DescribableList<GhprbExtension, GhprbExtensionDescriptor> getExtensions() { if (extensions == null) { extensions = new DescribableList<GhprbExtension, GhprbExtensionDescriptor>(Saveable.NOOP, Util.fixNull(extensions)); extensions.add(new GhprbSimpleStatus()); } return extensions; }
@Override protected void addBuildStep() { p.getBuildWrappersList().add(wrapper); } }
/** * Performs a configuration round-trip testing for a publisher. */ protected <P extends Publisher> P configRoundtrip(P before) throws Exception { FreeStyleProject p = createFreeStyleProject(); p.getPublishersList().add(before); configRoundtrip(p); return (P)p.getPublishersList().get(before.getClass()); }
/** * Performs a configuration round-trip testing for a builder. */ protected <B extends Builder> B configRoundtrip(B before) throws Exception { FreeStyleProject p = createFreeStyleProject(); p.getBuildersList().add(before); configRoundtrip(p); return (B)p.getBuildersList().get(before.getClass()); }
/** * Performs a configuration round-trip testing for a builder. */ protected <B extends Builder> B configRoundtrip(B before) throws Exception { FreeStyleProject p = createFreeStyleProject(); p.getBuildersList().add(before); configRoundtrip(p); return (B) p.getBuildersList().get(before.getClass()); }
/** * Performs a configuration round-trip testing for a publisher. */ protected <P extends Publisher> P configRoundtrip(P before) throws Exception { FreeStyleProject p = createFreeStyleProject(); p.getPublishersList().add(before); configRoundtrip(p); return (P)p.getPublishersList().get(before.getClass()); }
public static void setEnvironmentVariables(JenkinsRule j, Map<String, String> params) throws IOException { EnvironmentVariablesNodeProperty prop = new EnvironmentVariablesNodeProperty(); EnvVars envVars = prop.getEnvVars(); envVars.putAll(params); j.jenkins.getGlobalNodeProperties().add(prop); }
@BeforeClass public static void setUpAgent() throws Exception { s = j.createOnlineSlave(); s.setNumExecutors(4); s.setLabelString("some-label docker test"); s.getNodeProperties().add(new EnvironmentVariablesNodeProperty(new EnvironmentVariablesNodeProperty.Entry("ONAGENT", "true"))); }
@BeforeClass public static void setUpAgent() throws Exception { s = j.createOnlineSlave(); s.setLabelString("some-label docker"); s.getNodeProperties().add( new EnvironmentVariablesNodeProperty( new EnvironmentVariablesNodeProperty.Entry("HAS_BACKSLASHES", "C:\\Windows"), new EnvironmentVariablesNodeProperty.Entry("FOO", "OTHER"))); }
@Test public void testPostUnit() throws Exception { TestUtils.addCopyBuildStep(p, TestUtils.JUNIT_XML, JUnitTestProvider.class, "go-torch-junit.xml"); p.getPublishersList().add(TestUtils.getDefaultXUnitPublisher()); FreeStyleBuild build = buildWithConduit(getFetchDiffResponse(), null, new JSONObject()); assertEquals(Result.SUCCESS, build.getResult()); assertLogContains("Publishing unit results to Harbormaster for 35 tests", build); }