2

I'm looking for a way to deploy on Heroku a Rails API and an ember-cli application. My directories structure is something like that:

  • application
    • frontend
    • rails-api

Can someone help me? I'm really new Heroku user.

PS: I don't want to use gems like 'ember-cli-rails'

cris
  • 17
  • 2
  • Heroku is very easy to deploy to if you are using one of their predefined app containers. You are not, so you'll need a custom Heroku build pack combining Rails and Ember. You might want to look around and see if someone has created one, otherwise you have to build one..Here's a place to start https://elements.heroku.com/buildpacks -- – Elvn Sep 15 '15 at 13:20
  • I read about that but i don't found anything like what i'm trying to do. Maybe it is because my ignorance. – cris Sep 15 '15 at 16:03
  • You will need a custom build pack in order to deploy a non-default app to Heroku. You could contact Heroku support and ask them if they have any plans to supply a ember/rails app deploy script. For someone without production app deployment experience, the simpler option is to use the ember gem and use the default Rails app slug creation/deployment Heroku offers. Good luck with whatever you decide. – Elvn Sep 15 '15 at 18:37
  • [This question](http://stackoverflow.com/questions/5977234/how-can-i-push-a-part-of-my-git-repo-to-heroku) explains how you can push specific folders to heroku. In general though you will find it a lot easier keeping your application split across separate repos. – Dhaulagiri Sep 17 '15 at 14:07

1 Answers1

1

I would deploy them separately, and keep them in separate git repos.

Ember

Use ember-cli-deploy. I would suggest you look into the ember-cli-deploy-lightning-pack. There is a presentation about it here.

This automates the release process -

  • Builds your Ember app, with asset fingerprints
  • gzips the assets
  • Uploads changed files to AWS S3
  • Puts the full content of your index.html into Redis

Rails

  • deploy your rails-api app to heroku normally
  • include a redis addon
  • set up the route which serves index.html to query it directly from Redis instead
  • I would suggest aliasing all non-api routes (ie a catchall route) to the root route so you can 'deep link' to your ember app

A big advantage of this process is that you can deploy changes to your frontend very quickly, and without having to take down or restart the server.

andorov
  • 4,197
  • 3
  • 39
  • 52