Skip to content
Permalink
Browse files
First step in fixing JENKINS-19658
  • Loading branch information
MadsNielsen committed Mar 5, 2014
1 parent e586cba commit 2a610b31eac243b27e54b5e162618ca3e0436e48
@@ -78,9 +78,6 @@ public boolean perform( AbstractBuild<?, ?> build, Launcher launcher, BuildListe

boolean result = true;
out = listener.getLogger();

logger.fine( "BEGINNING NOTIFIER: " + build.getProject().getPublishersList() );

status = new Status();

/* Prepare job variables */
@@ -367,7 +367,6 @@ public void setAddPostBuild(boolean addPostBuild) {

private boolean checkInput(TaskListener listener) {
PrintStream out = listener.getLogger();

out.println("[" + Config.nameShort + "] Verifying input");

/* Check baseline template */
@@ -392,6 +391,7 @@ private boolean checkInput(TaskListener listener) {
}
} else {
out.println("[" + Config.nameShort + "] You cannot create a baseline in this mode");
return false;
}
}

@@ -661,7 +661,7 @@ public PollingResult compareRemoteRevisionWith(AbstractProject<?, ?> project, La

logger.fine("Let's go!");

/* Check input */
/* Check input */
if (checkInput(listener)) {

printParameters(out);
@@ -5,6 +5,7 @@
import hudson.model.Project;
import hudson.scm.ChangeLogSet;
import hudson.scm.ChangeLogSet.Entry;
import hudson.slaves.DumbSlave;

import java.io.File;
import java.io.IOException;
@@ -336,15 +337,16 @@ public boolean perform( AbstractBuild<?, ?> build, Launcher launcher, BuildListe
}
}

public AbstractBuild<?, ?> buildProject( AbstractProject<?, ?> project, boolean fail ) throws IOException {
return buildProject( project, fail, null );
public AbstractBuild<?, ?> buildProject( AbstractProject<?, ?> project, boolean fail ) throws IOException, Exception {
return buildProject( project, fail, createSlave() );
}

public AbstractBuild<?, ?> buildProject( AbstractProject<?, ?> project, boolean fail, Slave slave ) throws IOException {

if( slave != null ) {
logger.fine( "Running on " + slave );
project.setAssignedNode( slave );
System.out.println( String.format( "[SLAVE-CONFIG] Running on %s", slave.getSelfLabel().getName() ) );
logger.fine( String.format( "Running on %s", slave.getSelfLabel().getName() ) );
project.setAssignedLabel(slave.getSelfLabel());
}

EnableLoggerAction action = null;
@@ -355,7 +357,7 @@ public boolean perform( AbstractBuild<?, ?> build, Launcher launcher, BuildListe

AbstractBuild<?, ?> build = null;
try {
build = project.scheduleBuild2( 0, new Cause.UserCause(), action ).get();
build = project.scheduleBuild2(0, new Cause.UserCause(), action ).get();
} catch( Exception e ) {
logger.info( "Build failed(" + (fail?"on purpose":"it should not?") + "): " + e.getMessage() );
}
@@ -4,6 +4,7 @@
import hudson.model.Project;
import hudson.model.Result;
import hudson.model.Slave;
import hudson.slaves.DumbSlave;
import net.praqma.clearcase.Deliver;
import net.praqma.clearcase.exceptions.ClearCaseException;
import net.praqma.clearcase.test.junit.ClearCaseRule;

0 comments on commit 2a610b3

Please sign in to comment.