NOTE: This package is deprecated, in favor of ember-cli-deploy-front-end-builds-pack, a new addon for use with Ember CLI Deploy.
Easily deploy your Ember CLI app to a front_end_builds Rails backend.
The deploy process involves:
- Creating a build of your ember-cli app
- Uploading your assets to S3
- Notifying your Rails backend with info about the new build
npm install --save-dev ember-cli-front-end-builds
Please make sure you have setup your Rails backend with the front_end_builds gem.
You should also setup the admin area and add your application.
You'll also need to setup a S3 bucket, and allow it to be accessed publicly. Add a policy such as:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadForGetBucketObjects",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::MY-BUCKET-NAME/*"
}
]
}
In your App's Brocfile.js
, you'll want to prepend your asset fingerprinting with your S3 Bucket URL:
var app = new EmberApp({
'fingerprint': {
prepend: "https://s3.amazonaws.com/MY-BUCKET-NAME/dist/"
}
});
Please note that if you are serving assets off S3 and your bucket is
not in the US Standard region your prepend string should be
https://MY-BUCKET-NAME.s3.amazonaws.com/dist/
.
To get started with deploy configuration simply run:
ember deploy:setup
This will ask you a series questions about your application and write a
configuration file to config/deploy.js
.
TODO
{
"production": {
"assets": {
"accessKeyId": "[your-id]",
"secretAccessKey": "[your-key]",
"bucket": "[your-s3-bucket]",
"prefix": "[optional, dir on S3 to dump all assets]",
"distPrefix": "[optional, dir on S3 to put `dist` in e.g. dist-{{SHA}}]"
},
"index": {
"app": "[app name, e.g. ted-ed-lesson-creator]",
"endpoints": [
"[endpoint to notify, e.g. http://local.ted.com:3000/ted-ed-lesson-creator]"
]
},
"build": {
"environment": "production" // optional, specify if you need an ember-cli build env different from your deploy environment (e.g. use `production` for my staging deploy)
}
}
}
To deploy your application just run
ember deploy --environment=ENV
Where ENV is the name of the environment you wish to deploy to.