Jenkins Ruby metrics插件无法复制.gitkeep

时间:2014-02-05 12:38:08

标签: ruby-on-rails jenkins

Jenkins Ruby metrics插件在将.gitkeep文件复制到日志目录时导致错误,因为它无法创建日志目录。

错误信息如下。

Publishing rcov report...

ERROR: Publisher hudson.plugins.rubyMetrics.rcov.RcovPublisher aborted due to exception
Failed to copy /Users/Shared/Jenkins/Home/jobs/RailsApp/workspace/log/.gitkeep to /Users/Shared/Jenkins/Home/jobs/RailsApp/builds/2014-02-05_21-07-52/log/.gitkeep due to failed to create the parent directory for /Users/Shared/Jenkins/Home/jobs/RailsApp/builds/2014-02-05_21-07-52/log/.gitkeep
    at org.apache.tools.ant.taskdefs.Copy.doFileOperations(Copy.java:914)
    at org.apache.tools.ant.taskdefs.Copy.execute(Copy.java:567)
    at hudson.Util.copyFile(Util.java:922)
    at hudson.FilePath$38$1.visit(FilePath.java:1937)
    at hudson.util.DirScanner.scanSingle(DirScanner.java:49)
    at hudson.util.DirScanner$Glob.scan(DirScanner.java:131)
    at hudson.FilePath$38.invoke(FilePath.java:1932)
    at hudson.FilePath$38.invoke(FilePath.java:1925)
    at hudson.FilePath.act(FilePath.java:914)
    at hudson.FilePath.act(FilePath.java:887)
    at hudson.FilePath.copyRecursiveTo(FilePath.java:1925)
    at hudson.FilePath.copyRecursiveTo(FilePath.java:1911)
    at hudson.FilePath.copyRecursiveTo(FilePath.java:1894)
    at hudson.plugins.rubyMetrics.Utils.moveReportsToBuildRootDir(Utils.java:28)
    at hudson.plugins.rubyMetrics.Utils.moveReportsToBuildRootDir(Utils.java:12)
    at hudson.plugins.rubyMetrics.HtmlPublisher.prepareMetricsReportBeforeParse(HtmlPublisher.java:30)
    at hudson.plugins.rubyMetrics.rcov.RcovPublisher.perform(RcovPublisher.java:50)
    at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:784)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:756)
    at hudson.model.Build$BuildExecution.post2(Build.java:183)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:705)
    at hudson.model.Run.execute(Run.java:1695)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:231)
Caused by: java.io.IOException: failed to create the parent directory for /Users/Shared/Jenkins/Home/jobs/RailsApp/builds/2014-02-05_21-07-52/log/.gitkeep
    at org.apache.tools.ant.util.ResourceUtils.copyResource(ResourceUtils.java:512)
    at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:559)
    at org.apache.tools.ant.taskdefs.Copy.doFileOperations(Copy.java:899)
    ... 25 more 

Jenkins没有创建log'目录'但记录文件'。 Jenkins当然有权读/写目录。有任何想法吗?提前谢谢。

1 个答案:

答案 0 :(得分:0)

我花了很多时间来解决这个问题。

实际上,当您激活Ruby metrics plugin时,您必须提供一个目录。如果您没有,则默认文件夹为日志,这是导致错误的原因。

因此,转到您的项目配置并在发布Rcov报告部分,您只需填写目录。

享受:)