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

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

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

Jenkins.getBuildDirFor介绍

暂无

代码示例

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

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

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

  1. private void removeDeletedBuilds(){
  2. Iterator<DiskUsageBuildInformation> iterator= buildDiskUsage.iterator();
  3. while(iterator.hasNext()){
  4. DiskUsageBuildInformation information = iterator.next();
  5. File buildDir = new File(Jenkins.getInstance().getBuildDirFor(job), information.getId());
  6. if(!buildDir.exists())
  7. buildDiskUsage.remove(information);
  8. }
  9. }
  10. }

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

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

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

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

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

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

相关文章

Jenkins类方法