Has anyone deployed an ember-cli + rails app in Heroku like this one? https://github.com/bostonember/website If yes, how did/do you deploy?
有人在Heroku中部署了像这样的ember-cli + rails应用程序吗? https://github.com/bostonember/website如果是,您是如何/部署的?
I know that ember-cli produces all the necessary code in the dist/ dir, which should be placed (copied) under rails' public/ directory but I am not sure how and when to do that given that Heroku does not allow any write access in its filesystem. So if anyone has already done that, let me know :)
我知道ember-cli会在dist / dir中生成所有必需的代码,这些代码应该放在(复制)rails的public /目录下但是我不知道如何以及何时这样做,因为Heroku不允许任何写访问在它的文件系统中。所以如果有人已经这样做了,请告诉我:)
The reason that I chose ember-cli instead of the ember-rails gem is that I don't want to be dependent on any rails' gem developer. I think ember-cli is a good option as long as I can deploy efficiently in heroku :D
我之所以选择ember-cli而不是ember-rails gem,是因为我不想依赖任何rails的宝石开发者。我认为只要我能在heroku中有效部署,ember-cli就是一个不错的选择:D
3 个解决方案
#1
12
Dockyard worked through an example of this during a Boston Ember meetup. Here's the video.
在波士顿Ember聚会期间,造船厂就是这方面的一个例子。这是视频。
They posted the code online, the important part being the deploy task of the rakefile:
他们在线发布了代码,重要的部分是rakefile的部署任务:
task :deploy do
sh 'git checkout production'
sh 'git merge rails-served-html -m "Merging master for deployment"'
sh 'rm -rf backend/public/assets'
sh 'cd frontend && BROCCOLI_ENV=production broccoli build ../backend/public/assets && cd ..'
unless `git status` =~ /nothing to commit, working directory clean/
sh 'git add -A'
sh 'git commit -m "Asset compilation for deployment"'
end
sh 'git subtree push -P backend heroku master'
sh 'git checkout -'
end
Essentially, you copy the dist
from ember-cli
directly into Rails public folder, then deploy the rails subfolder as a rails app to Heroku using subtree. I've done this myself, and it works well.
基本上,您将dist从ember-cli直接复制到Rails公共文件夹,然后使用子树将rails子文件夹作为rails应用程序部署到Heroku。我自己做了这个,效果很好。
Note that the approach in the "Lightening fast deployments" blog post @eXa linked to is ultimately better, since you can change your Ember app without touching or redploying your Rails app.
请注意,链接到@eXa的“Lightening fast deploymentments”博客文章中的方法最终会更好,因为您可以在不触及或重新部署Rails应用程序的情况下更改您的Ember应用程序。
#2
4
I'm planning on doing it and I found this:
我打算这样做,我发现了这个:
http://blog.abuiles.com/blog/2014/07/08/lightning-fast-deployments-with-rails/
#3
0
https://github.com/tonycoco/heroku-buildpack-ember-cli for your Ember CLI application, and the standard Rails app deploy for the Rails app.
https://github.com/tonycoco/heroku-buildpack-ember-cli用于您的Ember CLI应用程序,以及用于Rails应用程序的标准Rails应用程序部署。
#1
12
Dockyard worked through an example of this during a Boston Ember meetup. Here's the video.
在波士顿Ember聚会期间,造船厂就是这方面的一个例子。这是视频。
They posted the code online, the important part being the deploy task of the rakefile:
他们在线发布了代码,重要的部分是rakefile的部署任务:
task :deploy do
sh 'git checkout production'
sh 'git merge rails-served-html -m "Merging master for deployment"'
sh 'rm -rf backend/public/assets'
sh 'cd frontend && BROCCOLI_ENV=production broccoli build ../backend/public/assets && cd ..'
unless `git status` =~ /nothing to commit, working directory clean/
sh 'git add -A'
sh 'git commit -m "Asset compilation for deployment"'
end
sh 'git subtree push -P backend heroku master'
sh 'git checkout -'
end
Essentially, you copy the dist
from ember-cli
directly into Rails public folder, then deploy the rails subfolder as a rails app to Heroku using subtree. I've done this myself, and it works well.
基本上,您将dist从ember-cli直接复制到Rails公共文件夹,然后使用子树将rails子文件夹作为rails应用程序部署到Heroku。我自己做了这个,效果很好。
Note that the approach in the "Lightening fast deployments" blog post @eXa linked to is ultimately better, since you can change your Ember app without touching or redploying your Rails app.
请注意,链接到@eXa的“Lightening fast deploymentments”博客文章中的方法最终会更好,因为您可以在不触及或重新部署Rails应用程序的情况下更改您的Ember应用程序。
#2
4
I'm planning on doing it and I found this:
我打算这样做,我发现了这个:
http://blog.abuiles.com/blog/2014/07/08/lightning-fast-deployments-with-rails/
#3
0
https://github.com/tonycoco/heroku-buildpack-ember-cli for your Ember CLI application, and the standard Rails app deploy for the Rails app.
https://github.com/tonycoco/heroku-buildpack-ember-cli用于您的Ember CLI应用程序,以及用于Rails应用程序的标准Rails应用程序部署。