Skip to content

Commit

Permalink
Update for cli API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lukemelia committed Jul 27, 2015
1 parent db343d2 commit 474d1a8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions blueprints/lightning-deploy-config/files/config/deploy.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
var VALID_DEPLOY_ENVIRONMENTS = [ //update these to match what you call your deployment environments
var VALID_DEPLOY_TARGETS = [ //update these to match what you call your deployment targets
'dev',
'qa',
'prod'
];

module.exports = function(environment) {
module.exports = function(deployTarget) {
var ENV = {
build: {},
redis: {
Expand All @@ -15,28 +15,28 @@ module.exports = function(environment) {
prefix: '<%= dasherizedPackageName %>'
}
};
if (VALID_DEPLOY_ENVIRONMENTS.indexOf(environment) === -1) {
throw new Error('Invalid environment ' + environment);
if (VALID_DEPLOY_TARGETS.indexOf(deployTarget) === -1) {
throw new Error('Invalid deployTarget ' + deployTarget);
}

if (environment === 'dev') {
if (deployTarget === 'dev') {
ENV.build.environment = 'development';
ENV.redis.url = process.env.REDIS_URL || 'redis://0.0.0.0:6379/';
ENV.plugins = ['build', 'redis']; // only care about deploying index.html into redis in dev
}

if (environment === 'qa' || environment === 'prod') {
if (deployTarget === 'qa' || deployTarget === 'prod') {
ENV.build.environment = 'production';
ENV.s3.accessKeyId = process.env.AWS_KEY;
ENV.s3.secretAccessKey = process.env.AWS_SECRET;
ENV.s3.bucket = /* YOUR S3 BUCKET NAME */;
}

if (environment === 'qa') {
if (deployTarget === 'qa') {
ENV.redis.url = process.env.QA_REDIS_URL;
}

if (environment === 'prod') {
if (deployTarget === 'prod') {
ENV.redis.url = process.env.PROD_REDIS_URL;
}

Expand All @@ -49,7 +49,7 @@ module.exports = function(environment) {
* var Promise = require('ember-cli/lib/ext/promise');
* return new Promise(function(resolve, reject){
* var exec = require('child_process').exec;
* var command = 'heroku config:get REDISTOGO_URL --app my-app-' + environment;
* var command = 'heroku config:get REDISTOGO_URL --app my-app-' + deployTarget;
* exec(command, function (error, stdout, stderr) {
* ENV.redis.url = stdout.replace(/\n/, '').replace(/\/\/redistogo:/, '//:');
* if (error) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"dependencies": {
"ember-cli-deploy-build": "zapnito/ember-cli-deploy-build#4092f0aba15d7706ad44dfaeac6f574c6b19511c",
"ember-cli-deploy-gzip": "lukemelia/ember-cli-deploy-gzip#b618036a4502a897deed9612a653f1b5f032e915",
"ember-cli-deploy-redis": "zapnito/ember-cli-deploy-redis#432de031b6faa5d98b3c4fa897d2291faf27a545",
"ember-cli-deploy-redis": "zapnito/ember-cli-deploy-redis#092c1164163168415b21a8e6286dbfd5d0fa78b8",
"ember-cli-deploy-s3": "zapnito/ember-cli-deploy-s3#076f35e7b53d1afa4672e6054fdd76ceda1fa948",
"ember-cli-deploy-manifest": "lukemelia/ember-cli-deploy-manifest#ca346b136001f98e04a5a135dd87157f1b297c81",
"ember-cli-deploy-revision-key": "zapnito/ember-cli-deploy-revision-key#972c9d1a74095d7f664ab0f92bc632155541aaa5"
Expand Down

0 comments on commit 474d1a8

Please sign in to comment.