jenkins.model.Jenkins.getBuildDirFor()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(166)

本文整理了Java中jenkins.model.Jenkins.getBuildDirFor()方法的一些代码示例,展示了Jenkins.getBuildDirFor()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Jenkins.getBuildDirFor()方法的具体详情如下:
包路径:jenkins.model.Jenkins
类名称:Jenkins
方法名:getBuildDirFor

Jenkins.getBuildDirFor介绍

暂无

代码示例

代码示例来源:origin: jenkinsci/jenkins

/**
 * Directory for storing {@link Run} records.
 * <p>
 * Some {@link Job}s may not have backing data store for {@link Run}s, but
 * those {@link Job}s that use file system for storing data should use this
 * directory for consistency.
 * 
 * @see RunMap
 */
public File getBuildDir() {
  // we use the null check variant so that people can write true unit tests with a mock ItemParent
  // and without a JenkinsRule. Such tests are of limited utility as there is a high risk of hitting
  // some code that needs the singleton, but for persistence migration test cases it makes sense to permit
  Jenkins j = Jenkins.getInstanceOrNull();
  if (j == null) {
    return new File(getRootDir(), "builds");
  }
  return j.getBuildDirFor(this);
}

代码示例来源:origin: org.jenkins-ci.plugins/disk-usage

private void removeDeletedBuilds(){
    Iterator<DiskUsageBuildInformation> iterator= buildDiskUsage.iterator();
    while(iterator.hasNext()){
      DiskUsageBuildInformation information = iterator.next();
      File buildDir = new File(Jenkins.getInstance().getBuildDirFor(job), information.getId());
      if(!buildDir.exists())
        buildDiskUsage.remove(information);
    }
  }
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

/**
 * Directory for storing {@link Run} records.
 * <p>
 * Some {@link Job}s may not have backing data store for {@link Run}s, but
 * those {@link Job}s that use file system for storing data should use this
 * directory for consistency.
 * 
 * @see RunMap
 */
public File getBuildDir() {
  // we use the null check variant so that people can write true unit tests with a mock ItemParent
  // and without a JenkinsRule. Such tests are of limited utility as there is a high risk of hitting
  // some code that needs the singleton, but for persistence migration test cases it makes sense to permit
  Jenkins j = Jenkins.getInstanceOrNull();
  if (j == null) {
    return new File(getRootDir(), "builds");
  }
  return j.getBuildDirFor(this);
}

代码示例来源:origin: org.jenkins-ci.plugins/disk-usage

Set<DiskUsageBuildInformation> informations = project.getAction(ProjectDiskUsageAction.class).getBuildsInformation();
for(DiskUsageBuildInformation information : informations){
  exceededFiles.add(new File(Jenkins.getInstance().getBuildDirFor(project), information.getId()));

代码示例来源:origin: org.jenkins-ci.plugins/disk-usage

long buildSize = DiskUsageUtil.getFileSize(new File(Jenkins.getInstance().getBuildDirFor(project), buildId), new ArrayList<File>());

相关文章

Jenkins类方法