/** * Creates {@link LocalLauncher}. Useful for launching processes. */ protected LocalLauncher createLocalLauncher() { return new LocalLauncher(StreamTaskListener.fromStdout()); }
/** * Creates {@link hudson.Launcher.LocalLauncher}. Useful for launching processes. */ public Launcher.LocalLauncher createLocalLauncher() { return new Launcher.LocalLauncher(StreamTaskListener.fromStdout()); }
/** * Creates {@link LocalLauncher}. Useful for launching processes. */ protected LocalLauncher createLocalLauncher() { return new LocalLauncher(StreamTaskListener.fromStdout()); }
/** * Creates {@link hudson.Launcher.LocalLauncher}. Useful for launching processes. */ public Launcher.LocalLauncher createLocalLauncher() { return new Launcher.LocalLauncher(StreamTaskListener.fromStdout()); }
/** * Creates {@link hudson.Launcher.LocalLauncher}. Useful for launching processes. */ public Launcher.LocalLauncher createLocalLauncher() { return new Launcher.LocalLauncher(StreamTaskListener.fromStdout()); }
/** * Creates {@link LocalLauncher}. Useful for launching processes. */ protected LocalLauncher createLocalLauncher() { return new LocalLauncher(StreamTaskListener.fromStdout()); }
/** * Creates {@link LocalLauncher}. Useful for launching processes. */ protected LocalLauncher createLocalLauncher() { return new LocalLauncher(StreamTaskListener.fromStdout()); }
public PollRunner(AbstractProject p, Cause cause, List<Action> actions) { this.project = p; this.cause = cause; this.buildActions = actions; // workaround for HUDSON-5406: // some (all?) SCMs require a serializable TaskListener for AbstractProject#pollSCMChanges // LogTaskListener is not serializable (at least not up until Hudson 1.352) TaskListener tl = new LogTaskListener(LOGGER, Level.INFO); if (tl instanceof Serializable) { this.taskListener = tl; } else { this.taskListener = StreamTaskListener.fromStdout(); } }
public BenchmarkBuildActionDisplay getBuildActionDisplay() { BenchmarkBuildActionDisplay buildDisplay = null; WeakReference<BenchmarkBuildActionDisplay> wr = _buildActionDisplay; if ( wr != null ) { buildDisplay = wr.get(); if ( buildDisplay != null ) return buildDisplay; } buildDisplay = new BenchmarkBuildActionDisplay( this, StreamTaskListener.fromStdout(), _decimalPlaces ); _buildActionDisplay = new WeakReference<BenchmarkBuildActionDisplay>( buildDisplay ); return buildDisplay; }
public void run() { try { StreamTaskListener task = StreamTaskListener.fromStdout(); int r = runElevated(slaveExe, "start", task, dir, nativeUtils); task.getLogger().println(r == 0 ? "Successfully started" : "start service failed. Exit code=" + r); } catch (IOException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } });
@Override public void run() { try { StreamTaskListener task = StreamTaskListener.fromStdout(); int r = runElevated(agentExe, "start", task, rootDir); task.getLogger().println(r == 0 ? "Successfully started" : "Start service failed. Exit code=" + r); } catch (IOException | InterruptedException ex) { // Level is severe, because the process won't be recovered in the service mode LOGGER.log(Level.SEVERE, "Failed to start the service with id=" + serviceId, ex); } } }
public void run() { try { StreamTaskListener task = StreamTaskListener.fromStdout(); int r = runElevated(slaveExe,"start",task,dir); task.getLogger().println(r==0?"Successfully started":"start service failed. Exit code="+r); } catch (IOException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } });
public void run() { try { StreamTaskListener task = StreamTaskListener.fromStdout(); int r = runElevated(slaveExe,"start",task,dir); task.getLogger().println(r==0?"Successfully started":"start service failed. Exit code="+r); } catch (IOException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } });
public void run() { try { StreamTaskListener task = StreamTaskListener.fromStdout(); int r = runElevated(slaveExe,"start",task,dir); task.getLogger().println(r==0?"Successfully started":"start service failed. Exit code="+r); } catch (IOException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } });
public Node call() throws Exception { // TODO: record the output somewhere JCloudsSlave jcloudsSlave = template.provisionSlave(StreamTaskListener.fromStdout(), provisioningId); Jenkins.getInstance().addNode(jcloudsSlave); /* Cloud instances may have a long init script. If we declare the provisioning complete by returning without the connect operation, NodeProvisioner may decide that it still wants one more instance, because it sees that (1) all the slaves are offline (because it's still being launched) and (2) there's no capacity provisioned yet. Deferring the completion of provisioning until the launch goes successful prevents this problem. */ ensureLaunched(jcloudsSlave); return jcloudsSlave; } })));
@Issue("JENKINS-16533") @Test public void pollingRespectExternalsWithRevision() throws Exception { // trunk has svn:externals="-r 1 ^/vendor vendor" (pinned) // latest commit on vendor is r3 (> r1) File repo = new CopyExisting(getClass().getResource("JENKINS-16533.zip")).allocate(); SubversionSCM scm = new SubversionSCM("file://" + repo.toURI().toURL().getPath() + "trunk"); // pinned externals should be recorded with ::p in revisions.txt FreeStyleProject p = r.createFreeStyleProject(); p.setScm(scm); p.setAssignedLabel(r.createSlave().getSelfLabel()); r.assertBuildStatusSuccess(p.scheduleBuild2(0).get()); // should not find any change (pinned externals should be skipped on poll) // fail if it checks the revision of external URL larger than the pinned revision assertFalse(p.poll(StreamTaskListener.fromStdout()).hasChanges()); }
public static void checkForSvnServe() throws InterruptedException { LocalLauncher launcher = new LocalLauncher(StreamTaskListener.fromStdout()); try { launcher.launch().cmds("svnserve","--help").start().join(); } catch (IOException e) { // TODO better to add a docker-fixtures test dep so CI builds can run these tests throw new AssumptionViolatedException("svnserve apparently not installed", e); } }
/** * Do the polling on the slave and make sure it works. */ @Issue("JENKINS-4299") @Test public void polling() throws Exception { // SLAVE_DEBUG_PORT = 8001; File repo = new CopyExisting(getClass().getResource("two-revisions.zip")).allocate(); SubversionSCM scm = new SubversionSCM("file://" + repo.toURI().toURL().getPath()); FreeStyleProject p = r.createFreeStyleProject(); p.setScm(scm); p.setAssignedLabel(r.createSlave().getSelfLabel()); r.assertBuildStatusSuccess(p.scheduleBuild2(0).get()); // initial polling on the slave for the code path that doesn't find any change assertFalse(p.poll(StreamTaskListener.fromStdout()).hasChanges()); createCommit(scm, "foo"); // polling on the slave for the code path that doesn't find any change assertTrue(p.poll(StreamTaskListener.fromStdout()).hasChanges()); }
private void invokeTestPollingExternalsForFile() throws Exception { // trunk has svn:externals="^/vendor/target.txt target.txt" File repo = new CopyExisting(getClass().getResource("JENKINS-20165.zip")).allocate(); String path = "file://" + repo.toURI().toURL().getPath(); SubversionSCM scm = new SubversionSCM(path + "trunk"); // first checkout FreeStyleProject p = r.createFreeStyleProject(); p.setScm(scm); p.setAssignedLabel(r.createSlave().getSelfLabel()); r.assertBuildStatusSuccess(p.scheduleBuild2(0).get()); // update target.txt in vendor SubversionSCM vendor = new SubversionSCM(path + "vendor"); createWorkingCopy(vendor); changeFiles("target.txt"); commitWorkingCopy("update"); // should detect change assertTrue(p.poll(StreamTaskListener.fromStdout()).hasChanges()); } }
@Test public void smokes() throws Exception { MercurialContainer container = docker.create(); Slave slave = container.createSlave(r); TaskListener listener = StreamTaskListener.fromStdout(); for (MercurialContainer.Version v : MercurialContainer.Version.values()) { HgExe hgExe = new HgExe(container.createInstallation(r, v, false, false, false, "", slave), null, slave.createLauncher(listener), slave, listener, new EnvVars()); assertThat(hgExe.popen(slave.getRootPath(), listener, true, new ArgumentListBuilder("version")), containsString("Mercurial Distributed SCM (version " + v.exactVersion + ")")); } }