【发布时间】:2016-05-30 02:50:51
【问题描述】:
我正在尝试使用 github webhooks 和 capistrano 实现持续部署例程。
我的计划是将我的 capistrano rake 任务放在一个 shell 脚本中,并从另一个 rails 项目(即 github webhook)的控制器操作中调用它。
这里是 shell 脚本 (wallet_deploy.sh)
#!/bin/bash
cd $HOME/work/wallet
bundle exec cap production deploy > wallet_deploy_log 2>&1
这是日志
/home/deploy/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/rubygems_integration.rb:304:in `block in replace_gem': capistrano is not part of the bundle. Add it to Gemfile. (Gem::LoadError)
from /home/deploy/.rbenv/versions/2.2.4/bin/cap:22:in `<main>'
这里是控制器动作
def release_request
system("./wallet_deploy.sh")
#DeployWorker.perform_async // tried using a worker too with no success
render :text => params.to_s
end
当我在 shell 中手动执行 Cap 部署时,它可以完美运行
deploy@ubuntu14-public:~/apps/ci/current$ ./wallet_deploy.sh
不确定我做错了什么,是否有不同的方法来实现这一点?
【问题讨论】:
标签: shell github capistrano webhooks continuous-deployment