/ember-cli-deploy

An Ember-CLI addon for lightening fast deployment of applications

Primary LanguageJavaScript

ember-cli-deploy

An Ember-CLI addon for lightening fast deployment of applications

Motivation

This addon was inspired by Luke Melia's RailsConf 2014 presentation - Lightning Fast Deployment of Your Rails-backed JavaScript app.

ember-cli-deploy was recently referenced in ember-cli 101, the new book by @abuiles, as the go to library for implementing Luke's ideas.

Synopsis

This plugin is designed to aid in the deployment workflow of an Ember CLI application. The workflow is designed to follow on from a successful ember build command and runs as follows:

  • Create an Ember CLI build
  • Deploy assets to S3
  • Deploy index.html to Redis
  • (At some point afterwards) Activate a released index.html to be the current live version

Installation

From within your Ember CLI application, run:

npm install --save-dev ember-cli-deploy

Configuration

Any of the command line options passed in to the following commands can alternatively be either exported as environment variables or specified in a .env file.

Simply change the option flag to be UPPERCASED and UNDER_SCORED, eg:

--redis-host would be specified as REDIS_HOST

ember deploy:assets

This command is responsible for pushing your assets to an S3 bucket.

Usage

ember deploy:assets <options>

Options

--dist-dir (optional)

Default: dist

Should point to the dist directory that contains the built assets.

--s3-access-key-id (required)

The access token that has permission to push to your S3 bucket.

--s3-secret-access-key (required)

The token secret that belongs to the s3-access-key-id.

--s3-bucket-name (required)

The S3 bucket to push assets to.

--s3-region (optional)

Default: us-east-1

The region that your S3 bucket sits in.

--file-pattern (optional)

Default: **/*.{js,css,png,gif,jpg}

A glob file pattern that specifies the files to be uploaded to S3.

ember deploy:index

This command is responsible for pushing your index.html file to a Redis instance.

Usage

ember deploy:index <options>

Options

--dist-dir (optional)

Default: dist

Should point to the dist directory that contains the built index.html.

--redis-host (required)

The host server of the Redis instance to deploy the index.html to.

--redis-port (required)

The host port of the Redis instance to deploy the index.html to.

--redis-password (optional)

Default: null

The password of the Redis instance to deploy the index.html to.

--git-root (optional)

Default: ''

The path to your project git repository. Unless specified here, this will default to your project root.

ember activate

This command is responsible for activating a deployed index.html file. The process of activating the index.html file will update the index:current entry in Redis to be the index.html file for the specified <key>.

Usage

ember activate <key> <options>

Arguments

<key> (required)

This should be the short commit hash for the a previously deployed index.html file.

Options

--redis-host (required)

The host server of the Redis instance to deploy the index.html to.

--redis-port (required)

The host port of the Redis instance to deploy the index.html to.

--redis-password (optional)

Default: null

The password of the Redis instance to deploy the index.html to.

Serving index.html

A super simple way to serve the index.html from Redis is to spin up your own instance of achambers/fuzzy-wookie

Simply click the 'Deploy to Heroku' button on the README and you will be creating your own instance on Heroku, complete with Redis addons in seconds. It couldn't be easier.

Tests

To run the tests, run:

npm test

Honourable Mentions

The following sites have contributed in some way, shape or form in the creation of this addon.

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality.

Maintainers

Release History