大佬教程收集整理的这篇文章主要介绍了如何在Heroku部署期间运行“grunt build”(angular and ruby-on-rails应用程序),大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我不想在本地编译我的资产然后将它们提交给git,我宁愿在Heroku上编译它们.也就是说,每当我的应用程序部署时,我都想自动在Heroku上运行grunt build.
有谁知道如何配置Heroku来做到这一点?
编辑
我知道服务器端资产编译可以使用Node.js应用程序,例如使用mbuchetics’ fork of the heroku nodejs buildpack.当我按照该站点的说明并推送到Heroku时,我收到以下错误
-----> Fetching custom git buildpack... done ! Push rejected,no Cedar-supported app detected
编辑2
暂时我正在使用在本地运行grunt构建的Rake任务进行部署.
task :deploy do system("rm -rf ./public/*") # empty the public directory system("cd ngapp; grunt build") # make a bogus manifest file to turn off asset compilation on heroku # see here: https://devcenter.heroku.com/articles/rails-asset-pipeline system("mkdir public/assets; touch public/assets/manifest-098f6bcd4621d373cade4e832627b4f6.json") system("git add public/") system("git commit -m \"deploying...\"") system("git push heroku master") end
服务器端解决方案更可取!
此解决方案使用多个构建包在生产中运行grunt构建.版本控制中没有构建工件.
以上是大佬教程为你收集整理的如何在Heroku部署期间运行“grunt build”(angular and ruby-on-rails应用程序)全部内容,希望文章能够帮你解决如何在Heroku部署期间运行“grunt build”(angular and ruby-on-rails应用程序)所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。