是否可以将 rake 任务和捆绑安装合并到一个命令中?
我将多个 rake 任务
组合成一个 rake 命令。只是想知道是否可以让一个命令在 rake 任务中运行“bundle install
”?
或者其他方式?
因此,当我将 Rails 应用程序部署到新服务器时,我所需要做的就是运行一个命令,它将获取所有依赖项并迁移数据库 settings.yaml 文件等
I have several rake tasks
combined into one rake command. Just wondering is it possible to have one command run the "bundle install
" within a rake task ?
Or other way around ?
So when I deploy my rails app to a new server all I need to do is just run one command and it will grab all the dependencies and migrate databases settings.yaml files etc
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你可以用 && 链接你的命令
例如:
响应很差,但它可以工作;-)
显然你可以使你的脚本
vi ./scripts/deploy.sh
you can chained your command with &&
For example :
It's poor response but it's work ;-)
Obviously you can make your script
vi ./scripts/deploy.sh
我已经看到这已经完成
bundle install &&捆绑执行 rake db:migrate
I've seen this been done
bundle install && bundle exec rake db:migrate