我们设置了一个Xcode CI机器人来轮询我们的git仓库,以便根据新提交构建。通常情况下,它运行得很好。然而,在强制推送后(我知道),机器人将失败,并且再也无法正确构建。解决方案是删除机器人并重新开始(并谴责自己强制推送)。
在Xcode构建日志中没有错误,在控制台上只能确认问题是什么(请参见最后一条日志)。
我可以看到...
在Xcode构建日志中没有错误,在控制台上只能确认问题是什么(请参见最后一条日志)。
Jan 28 08:15:51 macmini.local xcsbuildd[80853]: [CSBotSCMAction gitCloneRepositoryAtURL:branch:destinationPath:createDirectoryNamed:completionBlock:] : https://github.com/XXXXXXXX/iOS.git
Jan 28 08:15:51 macmini.local xcsbuildd[80853]: newRepoURL: https://github.com/XXXXXXXX/iOS.git
"https:\/\/githubuserformacmini@github.com\/XXXXXXXX\/iOS.git",
"https_github_com_XXXXXXXX_iOS_git"
"launchCommand" : "\/Applications\/Xcode.app\/Contents\/Developer\/usr\/bin\/git clone https:\/\/githubuserformacmini@github.com\/XXXXXXXX\/iOS.git --recursive --verbose --progress https_github_com_XXXXXXXX_iOS_git",
"launchPath" : "\/Applications\/Xcode.app\/Contents\/Developer\/usr\/bin\/git",
"GIT_ASKPASS" : "\/Applications\/Server.app\/Contents\/ServerRoot\/usr\/libexec\/xcs_ssh_auth_agent",
Jan 28 08:18:29 macmini.local xcsbuildd[80853]: Obtaining the HEAD hash at: /Library/Server/Xcode/Data/BotRuns/BotRun-187dbc1a-dae2-4ddc-a75b-75831de7ff09.bundle/tmp/https_github_com_XXXXXXXX_iOS_git
Jan 28 08:18:29 macmini.local xcsbuildd[80853]: [CSBotSCMAction gitHeadHashesRepositoryAtPath:branch:completionBlock:] : /Library/Server/Xcode/Data/BotRuns/BotRun-187dbc1a-dae2-4ddc-a75b-75831de7ff09.bundle/tmp/https_github_com_XXXXXXXX_iOS_git
Jan 28 08:18:29 macmini.local xcsbuildd[80853]: newRepoURL: file:///Library/Server/Xcode/Data/BotRuns/BotRun-187dbc1a-dae2-4ddc-a75b-75831de7ff09.bundle/tmp/https_github_com_XXXXXXXX_iOS_git/
"launchCommand" : "\/Applications\/Xcode.app\/Contents\/Developer\/usr\/bin\/git show-ref --heads",
"launchPath" : "\/Applications\/Xcode.app\/Contents\/Developer\/usr\/bin\/git",
"currentDirectoryPath" : "\/Library\/Server\/Xcode\/Data\/BotRuns\/BotRun-187dbc1a-dae2-4ddc-a75b-75831de7ff09.bundle\/tmp\/https_github_com_XXXXXXXX_iOS_git",
"launchCommand" : "\/Applications\/Xcode.app\/Contents\/Developer\/usr\/bin\/git checkout release",
"launchPath" : "\/Applications\/Xcode.app\/Contents\/Developer\/usr\/bin\/git",
"GIT_ASKPASS" : "\/Applications\/Server.app\/Contents\/ServerRoot\/usr\/libexec\/xcs_ssh_auth_agent",
"currentDirectoryPath" : "\/Library\/Server\/Xcode\/Data\/BotRuns\/BotRun-187dbc1a-dae2-4ddc-a75b-75831de7ff09.bundle\/tmp\/https_github_com_XXXXXXXX_iOS_git",
Jan 28 08:18:29 macmini.local xcsbuildd[80853]: [CSBotSCMAction gitHeadHashesRepositoryAtPath:branch:completionBlock:] : https://github.com/XXXXXXXX/iOS.git
Jan 28 08:18:29 macmini.local xcsbuildd[80853]: newRepoURL: https://github.com/XXXXXXXX/iOS.git
"https:\/\/githubuserformacmini@github.com\/XXXXXXXX\/iOS.git"
"launchCommand" : "\/Applications\/Xcode.app\/Contents\/Developer\/usr\/bin\/git ls-remote --heads https:\/\/githubuserformacmini@github.com\/XXXXXXXX\/iOS.git",
"launchPath" : "\/Applications\/Xcode.app\/Contents\/Developer\/usr\/bin\/git",
"GIT_ASKPASS" : "\/Applications\/Server.app\/Contents\/ServerRoot\/usr\/libexec\/xcs_ssh_auth_agent",
Jan 28 08:18:30 macmini.local xcsbuildd[80853]: [CSBotSCMAction gitCommitSummaryForRepositoryURL:betweenHashIdentifier:andHashIdentifier:completionBlock:] : /Library/Server/Xcode/Data/BotRuns/BotRun-187dbc1a-dae2-4ddc-a75b-75831de7ff09.bundle/tmp/https_github_com_XXXXXXXX_iOS_git
"launchCommand" : "\/Applications\/Xcode.app\/Contents\/Developer\/usr\/bin\/git log --no-color --name-status --format=fuller --date=iso e478616e4b3915846f7938fec24e8dc12cdae52a..f2c1b24a6b801ed9f7e60dce60add1851618da64",
"launchPath" : "\/Applications\/Xcode.app\/Contents\/Developer\/usr\/bin\/git",
"GIT_ASKPASS" : "\/Applications\/Server.app\/Contents\/ServerRoot\/usr\/libexec\/xcs_ssh_auth_agent",
"currentDirectoryPath" : "\/Library\/Server\/Xcode\/Data\/BotRuns\/BotRun-187dbc1a-dae2-4ddc-a75b-75831de7ff09.bundle\/tmp\/https_github_com_XXXXXXXX_iOS_git",
Jan 28 08:18:30 macmini.local xcsbuildd[80853]: [XCSCheckoutOperation.m:1033 7d02a310 +168ms] Error getting Git commit log in range e478616e4b3915846f7938fec24e8dc12cdae52a:f2c1b24a6b801ed9f7e60dce60add1851618da64 <stderr>= fatal: Invalid revision range e478616e4b3915846f7938fec24e8dc12cdae52a..f2c1b24a6b801ed9f7e60dce60add1851618da64
Jan 28 08:18:30 macmini.local xcsbuildd[80853]: [XCSCheckoutOperation.m:610 7d02a310 +0ms] Failed to get Git commit history for repo with error Error Domain=CSBotSCMAction Code=-1000 "fatal: Invalid revision range e478616e4b3915846f7938fec24e8dc12cdae52a..f2c1b24a6b801ed9f7e60dce60add1851618da64
我可以看到...
git log --no-color --name-status --format=fuller --date=iso e478616e4b3915846f7938fec24e8dc12cdae52a..f2c1b24a6b801ed9f7e60dce60add1851618da64
...来自集成的内容。 e478616e4b3915846f7938fec24e8dc12cdae52a 是在我强制使用 f2c1b24a6b801ed9f7e60dce60add1851618da64 时被删除的提交(我猜测)。我不知道机器人在哪里保留这些信息。我尝试从 /Library/Server/Xcode/Data/BotRuns 中删除所有内容,但没有起作用。我想也许它是从 /Library/Server/Xcode/Data/BotRuns/Latest 中获取最后一个哈希值,但是并不是这样。我还在 /Library/Server/Xcode 的许多其他目录中进行了挖掘,但没有看到任何东西。
如果 Xcode 的 CI 方法能够给我们对 git 工作流程的任何控制就好了。配置选项非常少。也许删除是唯一的方法。