dB'*_*dB' 6 git ruby-on-rails heroku angularjs gruntjs
我想在Heroku上部署一个angular + rails应用程序.该应用程序是基于Emmanual Oda的示例代码构建的,并使用Grunt编译其资产.
我不想在本地编译我的资产然后将它们提交给git,我宁愿在Heroku上编译它们.也就是说,grunt build每当我的应用程序部署时,我都希望自动运行Heroku.
有谁知道如何配置Heroku来做到这一点?
编辑
我知道Node.js应用程序可以进行服务器端资产编译,例如使用mbuchetics的heroku nodejs buildpack的fork.但是,当我按照该站点的说明并推送到Heroku时,我收到以下错误
-----> Fetching custom git buildpack... done
! Push rejected, no Cedar-supported app detected
Run Code Online (Sandbox Code Playgroud)
编辑2
目前我正在使用grunt build本地运行的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
Run Code Online (Sandbox Code Playgroud)
服务器端解决方案更可取!
我相信这就是你想要的:http://www.angularonrails.com/deploy-angular-rails-single-page-application-heroku/
此解决方案使用多个构建包grunt build在生产中运行.版本控制中没有构建工件.
| 归档时间: |
|
| 查看次数: |
2150 次 |
| 最近记录: |