本文整理了Java中hudson.model.AbstractBuild.getPreviousBuild()
方法的一些代码示例,展示了AbstractBuild.getPreviousBuild()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AbstractBuild.getPreviousBuild()
方法的具体详情如下:
包路径:hudson.model.AbstractBuild
类名称:AbstractBuild
方法名:getPreviousBuild
暂无
代码示例来源:origin: jenkinsci/jenkins
@Deprecated
public boolean checkout(AbstractBuild<?,?> build, Launcher launcher, FilePath workspace, BuildListener listener, @Nonnull File changelogFile) throws IOException, InterruptedException {
AbstractBuild<?,?> prev = build.getPreviousBuild();
checkout((Run) build, launcher, workspace, listener, changelogFile, prev != null ? prev.getAction(SCMRevisionState.class) : null);
return true;
}
代码示例来源:origin: jenkinsci/jenkins
/**
* Returns true if this user has made a commit to this project.
*
* @since 1.191
*/
public boolean hasParticipant(User user) {
for( R build = getLastBuild(); build!=null; build=build.getPreviousBuild())
if(build.hasParticipant(user))
return true;
return false;
}
代码示例来源:origin: jenkinsci/jenkins
/**
* Gets some build that has a live workspace.
*
* @return null if no such build exists.
*/
public final R getSomeBuildWithWorkspace() {
int cnt=0;
for (R b = getLastBuild(); cnt<5 && b!=null; b=b.getPreviousBuild()) {
FilePath ws = b.getWorkspace();
if (ws!=null) return b;
}
return null;
}
代码示例来源:origin: jenkinsci/jenkins
private R getSomeBuildWithExistingWorkspace() throws IOException, InterruptedException {
int cnt=0;
for (R b = getLastBuild(); cnt<5 && b!=null; b=b.getPreviousBuild()) {
FilePath ws = b.getWorkspace();
if (ws!=null && ws.exists()) return b;
}
return null;
}
代码示例来源:origin: jenkinsci/jenkins
public void doRssLatest(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
final List<Run> lastBuilds = new ArrayList<>();
for (AbstractProject<?, ?> p : Jenkins.get().allItems(AbstractProject.class)) {
for (AbstractBuild<?, ?> b = p.getLastBuild(); b != null; b = b.getPreviousBuild()) {
if (relatedTo(b)) {
lastBuilds.add(b);
break;
}
}
}
// historically these have been reported sorted by project name, we switched to the lazy iteration
// so we only have to sort the sublist of runs rather than the full list of irrelevant projects
lastBuilds.sort((o1, o2) -> Items.BY_FULL_NAME.compare(o1.getParent(), o2.getParent()));
rss(req, rsp, " latest build", RunList.fromRuns(lastBuilds), Run.FEED_ADAPTER_LATEST);
}
代码示例来源:origin: jenkinsci/jenkins
for (R r=lb; r!=null; r=r.getPreviousBuild()) {
SCMRevisionState s = r.getAction(SCMRevisionState.class);
if (s!=null) {
代码示例来源:origin: org.jenkins-ci.plugins/violations
/**
* Get the previous ViolationsReport
* @return the previous report if present, null otherwise.
*/
public ViolationsReport previous() {
return findViolationsReport(build.getPreviousBuild());
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
private <U extends AbstractTestResultAction> U getPreviousResult(Class<U> type) {
AbstractBuild<?,?> b = owner;
while(true) {
b = b.getPreviousBuild();
if(b==null)
return null;
U r = b.getAction(type);
if(r!=null)
return r;
}
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
private <U extends AbstractTestResultAction> U getPreviousResult(Class<U> type) {
AbstractBuild<?,?> b = owner;
while(true) {
b = b.getPreviousBuild();
if(b==null)
return null;
U r = b.getAction(type);
if(r!=null)
return r;
}
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
@Deprecated
public boolean checkout(AbstractBuild<?,?> build, Launcher launcher, FilePath workspace, BuildListener listener, @Nonnull File changelogFile) throws IOException, InterruptedException {
AbstractBuild<?,?> prev = build.getPreviousBuild();
checkout((Run) build, launcher, workspace, listener, changelogFile, prev != null ? prev.getAction(SCMRevisionState.class) : null);
return true;
}
代码示例来源:origin: org.hudsonci.plugins/instant-messaging
/**
* {@inheritDoc}
*/
@Override
public boolean notificationWanted(final AbstractBuild<?, ?> build) {
Assert.notNull(build, "Parameter 'build' must not be null.");
final AbstractBuild<?, ?> previousBuild = build.getPreviousBuild();
return (previousBuild == null)
|| (build.getResult() != previousBuild.getResult());
}
};
代码示例来源:origin: jenkinsci/instant-messaging-plugin
/**
* {@inheritDoc}
*/
@Override
public boolean notificationWanted(final AbstractBuild<?, ?> build) {
Assert.notNull(build, "Parameter 'build' must not be null.");
final AbstractBuild<?, ?> previousBuild = build.getPreviousBuild();
return (previousBuild == null)
|| (build.getResult() != previousBuild.getResult());
}
};
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
/**
* Returns true if this user has made a commit to this project.
*
* @since 1.191
*/
public boolean hasParticipant(User user) {
for( R build = getLastBuild(); build!=null; build=build.getPreviousBuild())
if(build.hasParticipant(user))
return true;
return false;
}
代码示例来源:origin: org.hudsonci.plugins/subversion
public SubversionChangeLogBuilder(AbstractBuild<?,?> build, BuildListener listener, SubversionSCM scm) throws IOException {
previousRevisions = SubversionSCM.parseRevisionFile(build.getPreviousBuild());
thisRevisions = SubversionSCM.parseRevisionFile(build);
this.listener = listener;
this.scm = scm;
this.build = build;
}
代码示例来源:origin: org.hudsonci.plugins/instant-messaging
/**
* {@inheritDoc}
*/
@Override
public boolean notificationWanted(final AbstractBuild<?, ?> build) {
final AbstractBuild<?, ?> previousBuild = build.getPreviousBuild();
return (previousBuild == null)
|| (build.getResult() != previousBuild.getResult());
}
};
代码示例来源:origin: hudson/hudson-2.x
public void onLoad() {
Run pb = build.getPreviousBuild();
if (pb!=null) {
FingerprintAction a = pb.getAction(FingerprintAction.class);
if (a!=null)
compact(a);
}
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
/**
* Returns true if this user has made a commit to this project.
*
* @since 1.191
*/
public boolean hasParticipant(User user) {
for( R build = getLastBuild(); build!=null; build=build.getPreviousBuild())
if(build.hasParticipant(user))
return true;
return false;
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
public void onLoad() {
Run pb = build.getPreviousBuild();
if (pb!=null) {
FingerprintAction a = pb.getAction(FingerprintAction.class);
if (a!=null)
compact(a);
}
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
private R getSomeBuildWithExistingWorkspace() throws IOException, InterruptedException {
int cnt=0;
for (R b = getLastBuild(); cnt<5 && b!=null; b=b.getPreviousBuild()) {
FilePath ws = b.getWorkspace();
if (ws!=null && ws.exists()) return b;
}
return null;
}
代码示例来源:origin: org.jvnet.hudson.plugins/testng-plugin
public AbstractBuildAction getLastCompletedBuildAction() {
for (AbstractBuild<?, ?> build = getProject().getLastCompletedBuild(); build != null; build = build.getPreviousBuild()) {
final AbstractBuildAction action = build.getAction(getBuildActionClass());
if (action != null) {
return action;
}
}
return null;
}
内容来源于网络,如有侵权,请联系作者删除!