Skip to content

Commit

Permalink
[JENKINS-40477] - Remove dependency and simplify getLastBuildNode()
Browse files Browse the repository at this point in the history
Thanks to @jglick for the heads up.
  • Loading branch information
fredg02 committed Mar 1, 2017
1 parent eb570f7 commit a99b6aa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
5 changes: 0 additions & 5 deletions pom.xml
Expand Up @@ -54,11 +54,6 @@
<artifactId>junit</artifactId>
<version>1.11</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-job</artifactId>
<version>2.10</version>
</dependency>
</dependencies>

</project>
Expand Up @@ -25,7 +25,6 @@

import jenkins.model.Jenkins;

import org.jenkinsci.plugins.workflow.job.WorkflowRun;
import org.kohsuke.stapler.DataBoundConstructor;

import hudson.Extension;
Expand All @@ -45,15 +44,13 @@ public LastBuildNodeColumn() {

public String getLastBuildNode(Job<?, ?> job) {
Run<?, ?> lastBuild = job.getLastBuild();
if (lastBuild == null || lastBuild instanceof WorkflowRun) {
return null;
} else if (lastBuild instanceof AbstractBuild<?, ?>) {
if (lastBuild instanceof AbstractBuild<?, ?>) {
Node builtOn = ((AbstractBuild<?, ?>) lastBuild).getBuiltOn();
if (builtOn instanceof Jenkins) {
return "master";
}
return builtOn.getDisplayName();
}
}
return null;
}

Expand Down

0 comments on commit a99b6aa

Please sign in to comment.