use of hudson.model.Job in project blueocean-plugin by jenkinsci.
the class RunSearch method findRuns.
public static Iterable<BlueRun> findRuns(Job job, final Link parent) {
final List<BlueRun> runs = new ArrayList<>();
Iterable<Job> pipelines;
if (job != null) {
pipelines = ImmutableList.of(job);
} else {
pipelines = Jenkins.getActiveInstance().getItems(Job.class);
}
for (Job p : pipelines) {
RunList<? extends Run> runList = p.getBuilds();
for (Run r : runList) {
runs.add(AbstractRunImpl.getBlueRun(r, new Reachable() {
@Override
public Link getLink() {
return parent;
}
}));
}
}
return runs;
}
Aggregations