当使用我们的节点应用程序从外部 CI 服务器 (TeamCity) 推送时,我们看到 git 推送失败。它偶尔会发生一次(每 10 个构建中大约有 1 个),我无法确定是什么原因造成的。我在构建中添加了一个“失败时重试”步骤,它总是在第二次尝试时工作。
如果我更改 TeamCity 以对每个构建进行新的检查,它永远不会出错,但构建时间会增加一倍以上。
仅供参考,构建过程会进行检查,执行 grunt 构建,然后在本地提交构建,以便将构建的代码推送到 Heroku。我正在做一个应该涵盖这种情况的强制推送:
git push -f git@heroku.com:myapp.git trunk:master
这是从 Heroku 返回的日志摘录:
[[08:27:37][Step 7/7] Dependencies installed
[08:27:37][Step 7/7] -----> Building runtime environment
[08:27:37][Step 7/7] -----> Discovering process types
[08:27:37][Step 7/7] Procfile declares types -> web
[08:27:42][Step 7/7]
[08:27:42][Step 7/7] ! Heroku push rejected due to an unrecognized error.
[08:27:42][Step 7/7] ! We've been notified, see http://support.heroku.com if the problem persists.
[08:27:42][Step 7/7]
[08:27:42][Step 7/7]
[08:27:42][Step 7/7] To git@heroku.com:devgrade.git
[08:27:42][Step 7/7] ! [remote rejected] trunk -> master (pre-receive hook declined)
[08:27:42][Step 7/7] error: failed to push some refs to 'git@heroku.com:myapp.git'
[08:27:42][Step 7/7] Process exited with code 1
[08:27:42][Step 7/7] Step Push to Heroku (Command Line) failed