无法创建标签

时间:2013-02-20 09:57:45

标签: git cygwin cruisecontrol.net

我有一台运行Windows 2008R2的CruiseControl.Net构建机器。来源在git存储库中。 CruiseControl使用 cygwin 来访问git存储库。一切都很好,除了标记。我想标记每个成功的构建,所以这里是 ccnet.config

的一部分
<sourcecontrol type="git">
    <repository>git://xxx.xxx.xxx.xxx/Project</repository>
    <executable>C:\cygwin\bin\git</executable>
    <branch>projectName/branchToBuild</branch>
    <workingDirectory>Sources</workingDirectory>
    <autoGetSource>true</autoGetSource>
    <tagOnSuccess>true</tagOnSuccess>
    <tagCommitMessage>CCNet Build {0}</tagCommitMessage>
    <tagNameFormat>project/builds/v{0}</tagNameFormat>
    <committerName>CCNet</committerName>
</sourcecontrol>

但构建失败并出现错误:

ThoughtWorks.CruiseControl.Core.CruiseControlException: Source control operation failed: error: unable to create temporary sha1 filename : No such file or directory

error: unable to write tag file
. Process command: C:\cygwin\bin\git tag -a -m "CCNet Build 6.2.18.0" project/builds/v6.2.18.0
   at ThoughtWorks.CruiseControl.Core.Sourcecontrol.ProcessSourceControl.Execute(ProcessInfo processInfo)
   at ThoughtWorks.CruiseControl.Core.Sourcecontrol.Git.GitCreateTag(String tagName, String tagMessage, IIntegrationResult result)
   at ThoughtWorks.CruiseControl.Core.Sourcecontrol.Git.LabelSourceControl(IIntegrationResult result)
   at ThoughtWorks.CruiseControl.Core.IntegrationRunner.Build(IIntegrationResult result)
   at ThoughtWorks.CruiseControl.Core.IntegrationRunner.Integrate(IntegrationRequest request)

可能有什么不对?如果我从命令行执行相同的命令,一切正常。

谢谢!

通过将其添加到msbuild项目文件来解决:

<Exec Command='C:\cygwin\bin\git tag -a -m "CCNet Build" project/builds/v$(CCNetLabel)' ContinueOnError="true"/>
<Exec Command='C:\cygwin\bin\git push origin tag project/builds/v$(CCNetLabel)' ContinueOnError="true"/>

1 个答案:

答案 0 :(得分:1)

这看起来像运行ccnet服务的用户没有对存储库的写访问权。