本文整理了Java中hudson.model.AbstractBuild.getParent()
方法的一些代码示例,展示了AbstractBuild.getParent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AbstractBuild.getParent()
方法的具体详情如下:
包路径:hudson.model.AbstractBuild
类名称:AbstractBuild
方法名:getParent
暂无
代码示例来源:origin: jenkinsci/jenkins
public final P getProject() {
return getParent();
}
代码示例来源:origin: jenkinsci/jenkins
/**
* Gets the upstream builds of this build, which are the builds of the
* upstream projects whose artifacts feed into this build.
* @return empty if there is no {@link FingerprintAction} (even if there is an {@link Cause.UpstreamCause})
* @see #getTransitiveUpstreamBuilds()
*/
public Map<AbstractProject,Integer> getUpstreamBuilds() {
return _getUpstreamBuilds(getParent().getUpstreamProjects());
}
代码示例来源:origin: jenkinsci/jenkins
private static RepositoryBrowser<?> browserFromBuild(AbstractBuild<?,?> build) {
if (build == null) { // not generally allowed, but sometimes done in unit tests
return null;
}
return build.getParent().getScm().getEffectiveBrowser();
}
代码示例来源:origin: jenkinsci/jenkins
/**
* Works like {@link #getUpstreamBuilds()} but also includes all the transitive
* dependencies as well.
*/
public Map<AbstractProject,Integer> getTransitiveUpstreamBuilds() {
return _getUpstreamBuilds(getParent().getTransitiveUpstreamProjects());
}
代码示例来源:origin: jenkinsci/jenkins
/**
* Used to render the side panel "Back to project" link.
*
* <p>
* In a rare situation where a build can be reached from multiple paths,
* returning different URLs from this method based on situations might
* be desirable.
*
* <p>
* If you override this method, you'll most likely also want to override
* {@link #getDisplayName()}.
*/
public String getUpUrl() {
return Functions.getNearestAncestorUrl(Stapler.getCurrentRequest(),getParent())+'/';
}
代码示例来源:origin: jenkinsci/jenkins
/**
* Gets the downstream builds of this build, which are the builds of the
* downstream projects that use artifacts of this build.
*
* @return
* For each project with fingerprinting enabled, returns the range
* of builds (which can be empty if no build uses the artifact from this build or downstream is not {@link AbstractProject#isFingerprintConfigured}.)
*/
public Map<AbstractProject,RangeSet> getDownstreamBuilds() {
Map<AbstractProject,RangeSet> r = new HashMap<AbstractProject,RangeSet>();
for (AbstractProject p : getParent().getDownstreamProjects()) {
if (p.isFingerprintConfigured())
r.put(p,getDownstreamRelationship(p));
}
return r;
}
代码示例来源:origin: jenkinsci/jenkins
/**
* Returns the root directory of the checked-out module.
* <p>
* This is usually where {@code pom.xml}, {@code build.xml}
* and so on exists.
*/
public final FilePath getModuleRoot() {
FilePath ws = getWorkspace();
if (ws==null) return null;
return getParent().getScm().getModuleRoot(ws, this);
}
代码示例来源:origin: jenkinsci/jenkins
/**
* Returns the root directories of all checked-out modules.
* <p>
* Some SCMs support checking out multiple modules into the same workspace.
* In these cases, the returned array will have a length greater than one.
* @return The roots of all modules checked out from the SCM.
*/
public FilePath[] getModuleRoots() {
FilePath ws = getWorkspace();
if (ws==null) return null;
return getParent().getScm().getModuleRoots(ws, this);
}
代码示例来源:origin: jenkinsci/jenkins
for (Job<?, ?> downstream : jobs) {
if (Jenkins.getInstance().getItemByFullName(downstream.getFullName()) != downstream) {
LOGGER.log(Level.WARNING, "Running as {0} cannot even see {1} for trigger from {2}", new Object[] {Jenkins.getAuthentication().getName(), downstream, build.getParent()});
continue;
代码示例来源:origin: jenkinsci/jenkins
@Override
public String getWhyKeepLog() {
// if any of the downstream project is configured with 'keep dependency component',
// we need to keep this log
OUTER:
for (AbstractProject<?,?> p : getParent().getDownstreamProjects()) {
if (!p.isKeepDependencies()) continue;
AbstractBuild<?,?> fb = p.getFirstBuild();
if (fb==null) continue; // no active record
// is there any active build that depends on us?
for (int i : getDownstreamRelationship(p).listNumbersReverse()) {
// TODO: this is essentially a "find intersection between two sparse sequences"
// and we should be able to do much better.
if (i<fb.getNumber())
continue OUTER; // all the other records are younger than the first record, so pointless to search.
AbstractBuild<?,?> b = p.getBuildByNumber(i);
if (b!=null)
return Messages.AbstractBuild_KeptBecause(p.hasPermission(Item.READ) ? b.toString() : "?");
}
}
return super.getWhyKeepLog();
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
private static RepositoryBrowser<?> browserFromBuild(AbstractBuild<?,?> build) {
if (build == null) { // not generally allowed, but sometimes done in unit tests
return null;
}
return build.getParent().getScm().getEffectiveBrowser();
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
/**
* Gets the upstream builds of this build, which are the builds of the
* upstream projects whose artifacts feed into this build.
* @return empty if there is no {@link FingerprintAction} (even if there is an {@link Cause.UpstreamCause})
* @see #getTransitiveUpstreamBuilds()
*/
public Map<AbstractProject,Integer> getUpstreamBuilds() {
return _getUpstreamBuilds(getParent().getUpstreamProjects());
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
/**
* Works like {@link #getUpstreamBuilds()} but also includes all the transitive
* dependencies as well.
*/
public Map<AbstractProject,Integer> getTransitiveUpstreamBuilds() {
return _getUpstreamBuilds(getParent().getTransitiveUpstreamProjects());
}
代码示例来源:origin: org.eclipse.hudson/hudson-core
/**
* Gets the upstream builds of this build, which are the builds of the
* upstream projects whose artifacts feed into this build.
*
* @see #getTransitiveUpstreamBuilds()
*/
public Map<AbstractProject, Integer> getUpstreamBuilds() {
return _getUpstreamBuilds(getParent().getUpstreamProjects());
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
/**
* Works like {@link #getUpstreamBuilds()} but also includes all the transitive
* dependencies as well.
*/
public Map<AbstractProject,Integer> getTransitiveUpstreamBuilds() {
return _getUpstreamBuilds(getParent().getTransitiveUpstreamProjects());
}
代码示例来源:origin: org.jvnet.hudson.plugins/violations
/**
* Add a suppression to the set of suppressions.
* @param suppression the suppression to add.
*/
public void addSuppression(Suppression suppression)
throws IOException {
ViolationsConfig config = getLiveConfig();
if (config != null) {
config.getSuppressions().add(suppression);
((AbstractProject)build.getParent()).save();
}
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
/**
* Returns the root directory of the checked-out module.
* <p>
* This is usually where <tt>pom.xml</tt>, <tt>build.xml</tt>
* and so on exists.
*/
public final FilePath getModuleRoot() {
FilePath ws = getWorkspace();
if (ws==null) return null;
return getParent().getScm().getModuleRoot(ws, this);
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
/**
* Returns the root directories of all checked-out modules.
* <p>
* Some SCMs support checking out multiple modules into the same workspace.
* In these cases, the returned array will have a length greater than one.
* @return The roots of all modules checked out from the SCM.
*/
public FilePath[] getModuleRoots() {
FilePath ws = getWorkspace();
if (ws==null) return null;
return getParent().getScm().getModuleRoots(ws, this);
}
代码示例来源:origin: org.jenkins-ci.plugins/matrix-project
@Override
public String getTestResultPath(TestResult it) {
// Prepend Configuration path
return it.getOwner().getParent().getShortUrl() + super.getTestResultPath(it);
}
代码示例来源:origin: com.marvelution.jira.plugins/hudson-apiv2-plugin
/**
* {@inheritDoc}
*/
@Override
public ChangeLog getChangeLog(String jobname, Integer buildNumber) throws NoSuchJobException, NoSuchBuildException {
final AbstractBuild<?, ?> build = getHudsonBuild(jobname, buildNumber);
log.fine("Getting changelog of build: " + build.getNumber() + " of job " + build.getParent().getFullName());
return DozerUtils.getMapper().map(build.getChangeSet(), ChangeLog.class);
}
内容来源于网络,如有侵权,请联系作者删除!