我试图使用github webhooks和capistrano实现持续部署例程。当通过github webhook执行capistrano部署shell脚本失败
我的计划是将我的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中手动执行它
[email protected]:~/apps/ci/current$ ./wallet_deploy.sh
不知道我在做什么错,是否有不同的方法来实现这个?
谢谢!它的工作 –
@SharnJayantha你可以标记答案为接受,然后呢?谢谢 –