本文整理了Java中hudson.model.Build.getNumber()
方法的一些代码示例,展示了Build.getNumber()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Build.getNumber()
方法的具体详情如下:
包路径:hudson.model.Build
类名称:Build
方法名:getNumber
暂无
代码示例来源:origin: groupon/DotCi
public String getNearestRunUrl() {
final
Build r = getRun();
if (r == null) {
return null;
}
if (this.dynamicBuild.getNumber() == r.getNumber()) {
return getShortUrl() + "/console";
}
return Stapler.getCurrentRequest().getContextPath() + '/' + r.getUrl();
}
代码示例来源:origin: org.jenkins-ci.plugins/cloverphp
public DirectoryBrowserSupport doDynamic(StaplerRequest req, StaplerResponse rsp)
throws IOException, ServletException,
InterruptedException {
if (publisher.isPublishHtmlReport()) {
FilePath r = getWorkspaceReportDir();
if (exists(r, "index.html")) {
return new DirectoryBrowserSupport(
this, r, "Clover Html Report", "/cloverphp/clover.gif", false);
}
}
File reportDir = getLastBuildReportDir();
if (reportDir == null || getDisplayName() == null) {
throw new Failure(Messages.CloverProjectAction_InvalidConfiguration());
}
if (new File(reportDir, "clover.xml").exists()) {
if (project.getLastBuild() != null) {
int buildNumber = project.getLastBuild().getNumber();
rsp.sendRedirect2("../" + buildNumber + "/cloverphp-report");
}
}
throw new Failure(Messages.CloverProjectAction_HTML_NoCloverReportFound());
}
代码示例来源:origin: groupon/DotCi
@Override
public Object getDynamic(final String token, final StaplerRequest req, final StaplerResponse rsp) {
try {
final Build item = getRun(Combination.fromString(token));
if (item != null) {
if (item.getNumber() == this.getNumber()) {
return item;
} else {
// redirect the user to the correct URL
String url = Functions.joinPath(item.getUrl(), req.getRestOfPath());
final String qs = req.getQueryString();
if (qs != null) {
url += '?' + qs;
}
throw HttpResponses.redirectViaContextPath(url);
}
}
} catch (final IllegalArgumentException e) {
// failed to parse the token as Combination. Must be something else
}
return super.getDynamic(token, req, rsp);
}
内容来源于网络,如有侵权,请联系作者删除!