本文整理了Java中hudson.model.Run.getCauses
方法的一些代码示例,展示了Run.getCauses
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Run.getCauses
方法的具体详情如下:
包路径:hudson.model.Run
类名称:Run
方法名:getCauses
[英]Returns the Causes that tirggered a build.
If a build sits in the queue for a long time, multiple build requests made during this period are all rolled up into one build, hence this method may return a list.
[中]返回导致生成疲劳的原因。
如果一个构建长时间处于队列中,那么在此期间发出的多个构建请求都会汇总到一个构建中,因此此方法可能会返回一个列表。
代码示例来源:origin: jenkinsci/jenkins
/**
* Returns a {@link Cause} of a particular type.
*
* @since 1.362
*/
public @CheckForNull <T extends Cause> T getCause(Class<T> type) {
for (Cause c : getCauses())
if (type.isInstance(c))
return type.cast(c);
return null;
}
代码示例来源:origin: jenkinsci/jenkins
public UpstreamCause(Run<?, ?> up) {
upstreamBuild = up.getNumber();
upstreamProject = up.getParent().getFullName();
upstreamUrl = up.getParent().getUrl();
upstreamCauses = new ArrayList<Cause>();
Set<String> traversed = new HashSet<String>();
for (Cause c : up.getCauses()) {
upstreamCauses.add(trim(c, MAX_DEPTH, traversed));
}
}
代码示例来源:origin: jenkinsci/jenkins
listener.started(getCauses());
代码示例来源:origin: jenkinsci/gitlab-plugin
List<GitLabBranchBuild> builds = findBuildsFromUpstreamCauses(build.getCauses());
if (!builds.isEmpty()) {
return builds;
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
/**
* Returns a {@link Cause} of a particular type.
*
* @since 1.362
*/
public <T extends Cause> T getCause(Class<T> type) {
for (Cause c : getCauses())
if (type.isInstance(c))
return type.cast(c);
return null;
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
/**
* Returns a {@link Cause} of a particular type.
*
* @since 1.362
*/
public <T extends Cause> T getCause(Class<T> type) {
for (Cause c : getCauses())
if (type.isInstance(c))
return type.cast(c);
return null;
}
代码示例来源:origin: hudson/hudson-2.x
/**
* Returns a {@link Cause} of a particular type.
*
* @since 1.362
*/
public <T extends Cause> T getCause(Class<T> type) {
for (Cause c : getCauses())
if (type.isInstance(c))
return type.cast(c);
return null;
}
代码示例来源:origin: org.eclipse.hudson/hudson-core
/**
* Returns a {@link Cause} of a particular type.
*
* @since 1.362
*/
public <T extends Cause> T getCause(Class<T> type) {
for (Cause c : getCauses()) {
if (type.isInstance(c)) {
return type.cast(c);
}
}
return null;
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
/**
* Returns a {@link Cause} of a particular type.
*
* @since 1.362
*/
public @CheckForNull <T extends Cause> T getCause(Class<T> type) {
for (Cause c : getCauses())
if (type.isInstance(c))
return type.cast(c);
return null;
}
代码示例来源:origin: etsy/jenkins-master-project
public AbstractBuild findBuild(AbstractProject project, Cause cause) {
if (project == null) return null;
List<Run> builds = project.getBuilds();
for (Run build : builds) {
List<Cause> causes = build.getCauses();
if (causes.contains(cause)) {
return (AbstractBuild) build;
}
}
return null;
}
}
代码示例来源:origin: com.cloudbees.plugins/build-flow-plugin
@Override
public synchronized void onCompleted(Run<?, ?> finishedBuild,
TaskListener listener) {
List<Cause> causes = finishedBuild.getCauses();
for (Cause cause : causes) {
if (cause instanceof FlowCause) {
((FlowCause) cause).getAssociatedJob().buildCompleted();
}
}
}
代码示例来源:origin: com.cloudbees.plugins/build-flow-plugin
@Override
public synchronized void onFinalized(Run<?, ?> finalizedBuild) {
List<Cause> causes = finalizedBuild.getCauses();
for (Cause cause : causes) {
if (cause instanceof FlowCause) {
((FlowCause) cause).getAssociatedJob().buildFinalized();
}
}
}
}
代码示例来源:origin: com.cloudbees.plugins/build-flow-plugin
@Override
public synchronized void onStarted(Run<?, ?> startedBuild,
TaskListener listener) {
List<Cause> causes = startedBuild.getCauses();
for (Cause cause : causes) {
if (cause instanceof FlowCause) {
((FlowCause) cause).getAssociatedJob().buildStarted(
startedBuild);
}
}
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
public UpstreamCause(Run<?, ?> up) {
upstreamBuild = up.getNumber();
upstreamProject = up.getParent().getFullName();
upstreamUrl = up.getParent().getUrl();
upstreamCauses = new ArrayList<Cause>();
Set<String> traversed = new HashSet<String>();
for (Cause c : up.getCauses()) {
upstreamCauses.add(trim(c, MAX_DEPTH, traversed));
}
}
代码示例来源:origin: org.jenkins-ci.plugins/python-wrapper
@Override
public List<Cause> getCauses() {
initPython();
if (pexec.isImplemented(13)) {
return (List) pexec.execPython("get_causes");
} else {
return super.getCauses();
}
}
代码示例来源:origin: jenkinsci/m2release-plugin
public String getEntryAuthor(Run entry) {
// release builds are manual so get the UserCause
// and report rss entry as user who kicked off build
List<Cause> causes = entry.getCauses();
for (Cause cause : causes) {
if (cause instanceof ReleaseCause) {
return ((ReleaseCause) cause).getUserName();
}
}
// in the unexpected case where there is no user cause, return admin
return Mailer.descriptor().getAdminAddress();
}
}
代码示例来源:origin: hudson/hudson-2.x
public UpstreamCause(Run<?, ?> up) {
upstreamBuild = up.getNumber();
upstreamProject = up.getParent().getFullName();
upstreamUrl = up.getParent().getUrl();
upstreamCauses = new ArrayList<Cause>(up.getCauses());
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
public UpstreamCause(Run<?, ?> up) {
upstreamBuild = up.getNumber();
upstreamProject = up.getParent().getFullName();
upstreamUrl = up.getParent().getUrl();
upstreamCauses = new ArrayList<Cause>(up.getCauses());
}
代码示例来源:origin: org.eclipse.hudson/hudson-core
public UpstreamCause(Run<?, ?> up) {
upstreamBuild = up.getNumber();
upstreamProject = up.getParent().getFullName();
upstreamUrl = up.getParent().getUrl();
upstreamCauses = new ArrayList<Cause>(up.getCauses());
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
public UpstreamCause(Run<?, ?> up) {
upstreamBuild = up.getNumber();
upstreamProject = up.getParent().getFullName();
upstreamUrl = up.getParent().getUrl();
upstreamCauses = new ArrayList<Cause>(up.getCauses());
}
内容来源于网络,如有侵权,请联系作者删除!