1

谁能帮我理解这里发生了什么?詹金斯已经完美地工作了一段时间,突然间我一直遇到这个问题。是的,我确实尝试过搜索这个问题,但似乎我是唯一一个遇到过这个问题的人,因为我在任何地方都找不到任何关于它的信息。

请注意,以下一些信息已因隐私问题而更改,但我主要担心的是消息“没有返回状态代码 pid 74937 退出 2”,该消息不断添加到 git ls-remote 命令中。我不知道这是从哪里来的,也不知道这意味着什么。

我应该注意到我可以从我的本地机器上“ cap deploy ”就好了。我没有收到任何错误,并且应用程序已部署到远程服务器。

任何信息都会有所帮助,谢谢。

* executing `deploy'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
updating the cached checkout on all servers
executing locally: "git ls-remote git@github.com:private/repo.git (no"
sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: `git ls-remote git@github.com:private/repo.git (no'
*** [deploy:update_code] rolling back
* executing "rm -rf /rails_apps/private/releases/20120624130104; true"
servers: ["SERVER_IP"]
[SERVER_IP] executing command
command finished in 529ms
Command git ls-remote git@github.com:private/repo.git (no returned status code pid 74937 exit 2
4

1 回答 1

1

所以事实证明我忘记了一些我添加到 deploy.rb 以确定部署时我在哪个分支上的代码。好吧,capistrano 显然在寻找当前分支时遇到了问题。我能够通过添加以下内容来解决此问题...

def determine_branch
  git_branch = $1 if `git branch` =~ /\* (\S+)\s/m
  if git_branch =~ /no/
    "master"
  else
    git_branch
  end
end
于 2012-06-24T16:06:35.727 回答