ember-s3-redis-deploy
v1.0.1
Published
A very specific script to build an Ember app, push it to S3 and add the "index.html" to redis
Downloads
4
Readme
ember-s3-redis-deploy
A very specific command line script to build an Ember app, push it to S3, and update redis with the "index.html" contents.
dotenv loads and environment file based on the --environment
option. It should contain REDIS_URL, S3_BUCKET_NAME and AWS credentials required by aws s3 sync.
Keep an eye on https://github.com/stefanpenner/ember-cli/issues/1256 to see if something better comes along.
Installing
npm install --save-dev ember-s3-redis-deploy
Deploying
# adds the key 'photos-cms-client-app/canary/index.html'
# with the contents on 'app/index.html' to redis
ember-s3-redis-deploy --environment production --release stable
Serving
In the server app use the buildReleaseKey
convenience function to construct the key name saved in redis.
var buildReleaseKey = require('ember-s3-redis-deploy').buildReleaseKey;
/*
* Omitted server code
*/
app.get('/', function (request, response) {
// opionally allow for loading different releases
// i.e. example.com?release=beta
var release = request.query.release || 'stable';
var key = buildReleaseKey({
appName: 'my-ember-app-name',
release: release
});
var html = redisClient.get(key, function (html) {
response.send(html);
});
});