heroku / heroku-buildpack-emberjs

**This buildpack is deprecated!** Please use the official Node.js buildpack combined with the static or nginx buildpack instead.
71 stars 28 forks source link

heroku-buildpack-emberjs

This buildpack was an experimental OSS project demonstrating how to run Ember.js on Heroku. This buildpack has been deprecated and is no longer supported. For an alternative, consider using the heroku/nodejs buildpack with the heroku/nginx buildpack.

Intro

This is a Heroku Buildpack for Ember.js and ember-cli-fastboot applications.

Usage

This buildpack has a binary component, so it needs to be compiled beforehand. It's easier just to use the buildpack with the prebuilt binary.

$ heroku buildpacks:set https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/emberjs.tgz

Once the buildpack is set, you can git push heroku master like any other Heroku application.

EmberJS

Deploying a standard ember.js app on Heroku is simple. You can run the following commands to get started.

$ heroku create
$ heroku buildpacks:set https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/emberjs.tgz
$ git push heroku master
$ heroku open

Fastboot

Deploying an ember fastboot on Heroku is just as simple. You can run the following commands to get started.

$ heroku create
$ heroku buildpacks:set https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/emberjs.tgz
$ git push heroku master
$ heroku open

Problems

If you get an error setting the buildpack like the following:

$ heroku buildpacks:set https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/emberjs.tgz
▸ Invalid buildpack `heroku/emberjs`

This means that npm is having issues keeping the core heroku toolbelt plugins up to date. To fix this you can run these commands:

$ rm -rf ~/.heroku/node_modules/heroku-apps
$ heroku update

This causes the core plugins to be redownloaded with the latest version.

Architecture

The buildpack is built on top of three other buildpacks, to deliver a great Ember experience.

With the Node.js buildpack, you can rely on Heroku's first class support for node and npm. This allows the buildpack to install and setup the ember-cli toolchain as well as run the ember-fastboot-server as if it was any other Node.js application on the platform.

The ember-cli-deploy buildpack requires the ember app to be using ember-cli. In addition, you can customize your build on Heroku by using the ember-cli-deploy build pipeline. Fastboot is supported out of the box. The buildpack will build the assets, install any fastboot dependencies, and setup a default web process type to get you going quickly.

When not using fastboot, the static buildpack uses nginx to efficiently serve static assets while also handling HTML5 pushState, proxying, and other common frontend hosting configurations.

Contributing

The buildpack builds a CLI tool generically named, buildpack built on top of mruby-cli. It resides in the buildpack/ directory. buildpack is a CLI binary that has 3 subcommands that correspond to the Buildpack API:

Running Tests

First, you'll need the mruby-cli prerequisites setup. Once inside the buildpack/ directory:

$ docker-compose run mtest && docker-compose run bintest