Skip to content

Commit 1df0f52

Browse files
committed
update documentation for heroku and openshift deployment
1 parent 0775e64 commit 1df0f52

File tree

3 files changed

+43
-14
lines changed

3 files changed

+43
-14
lines changed

app/templates/server/config/local.env.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
module.exports = {
99
SESSION_SECRET: "<%= _.slugify(appname) + '-secret' %>",
10-
FACEBOOK_ID: "FACEBOOK-APP-ID",
11-
FACEBOOK_SECRET: "FACEBOOK-SECRET",
12-
TWITTER_ID: "TWITTER-APP-ID",
13-
TWITTER_SECRET: "TWITTER-SECRET",
14-
GOOGLE_ID: "GOOGLE-APP-ID",
15-
GOOGLE_SECRET: "GOOGLE-SECRET"
10+
FACEBOOK_ID: "app-id",
11+
FACEBOOK_SECRET: "secret",
12+
TWITTER_ID: "app-id",
13+
TWITTER_SECRET: "secret",
14+
GOOGLE_ID: "app-id",
15+
GOOGLE_SECRET: "secret"
1616
};

heroku/index.js

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,25 +138,40 @@ Generator.prototype.gitForcePush = function gitForcePush() {
138138
if (err) {
139139
this.log.error(err);
140140
} else {
141+
var hasWarning = false;
142+
141143
if(this.filters.mongoose) {
142144
this.log(chalk.yellow('\nBecause you\'re using mongoose, you must add mongoDB to your heroku app.\n\t' + 'from `/dist`: ' + chalk.bold('heroku addons:add mongohq') + '\n'));
145+
hasWarning = true;
143146
}
144147
if(this.filters.socketio) {
145148
this.log(chalk.yellow('Because you\'re using socketIO, you must enable websockets on your heroku app.\n\t' + 'from `/dist`: ' + chalk.bold('heroku labs:enable websockets') + '\n'));
149+
hasWarning = true;
146150
}
147151

148152
if(this.filters.facebookAuth) {
149-
this.log(chalk.yellow('Facebook auth requires you to set environment variables for\n\t' + 'FACEBOOK-APP-ID\n\t' + 'FACEBOOK-SECRET'));
153+
this.log(chalk.yellow('You will need to set environment variables for facebook auth. From `/dist`:\n\t' +
154+
chalk.bold('heroku config:set FACEBOOK_ID=appId\n\t') +
155+
chalk.bold('heroku config:set FACEBOOK_SECRET=secret\n')));
156+
hasWarning = true;
150157
}
151158
if(this.filters.googleAuth) {
152-
this.log(chalk.yellow('Google auth requires you to set environment variables for\n\t' + 'GOOGLE-APP-ID\n\t' + 'GOOGLE-SECRET'));
153-
159+
this.log(chalk.yellow('You will need to set environment variables for google auth. From `/dist`:\n\t' +
160+
chalk.bold('heroku config:set GOOGLE_ID=appId\n\t') +
161+
chalk.bold('heroku config:set GOOGLE_SECRET=secret\n')));
162+
hasWarning = true;
154163
}
155164
if(this.filters.twitterAuth) {
156-
this.log(chalk.yellow('Twitter auth requires you to set environment variables for\n\t' + 'TWITTER-APP-ID\n\t' + 'TWITTER-SECRET'));
165+
this.log(chalk.yellow('You will need to set environment variables for twitter auth. From `/dist`:\n\t' +
166+
chalk.bold('heroku config:set TWITTER_ID=appId\n\t') +
167+
chalk.bold('heroku config:set TWITTER_SECRET=secret\n')));
168+
hasWarning = true;
157169
}
158170

159171
this.log(chalk.green('\nYour app should now be live. To view it run\n\t' + chalk.bold('cd dist && heroku open')));
172+
if(hasWarning) {
173+
this.log(chalk.green('\nYou may need to address the issues mentioned above and restart the server for the app to work correctly.'));
174+
}
160175

161176
this.log(chalk.cyan('\nTo deploy a new build\n\t' + chalk.bold('grunt build') +
162177
'\nThen enter the dist folder to commit these updates:\n\t' + chalk.bold('cd dist && git add -A && git commit -m "describe your changes here"')));

openshift/index.js

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,26 +238,40 @@ Generator.prototype.gitForcePush = function gitForcePush() {
238238
this.log.error(err);
239239
} else {
240240
var host_url = '';
241+
var hasWarning = false;
241242
var before_hostname = this.dist_repo_url.indexOf('@') + 1;
242243
var after_hostname = this.dist_repo_url.length - ( this.deployedName.length + 12 );
243244
host_url = 'http://' + this.dist_repo_url.slice(before_hostname, after_hostname);
244245

245246
if(this.filters.socketio) {
246247
this.log(chalk.yellow('Openshift websockets use port 8000, you will need to update the client to connect to the correct port for sockets to work.\n\t' + 'in `/client/app/components/socket/socket.service`: ' + chalk.bold('var ioSocket = io.connect(\'' + host_url + ':8000' + '\')' + '\n')));
248+
hasWarning = true;
247249
}
248250

249251
if(this.filters.facebookAuth) {
250-
this.log(chalk.yellow('Facebook auth requires you to set environment variables for\n\t' + 'FACEBOOK-APP-ID\n\t' + 'FACEBOOK-SECRET'));
252+
this.log(chalk.yellow('You will need to set environment variables for facebook auth:\n\t' +
253+
chalk.bold('rhc set-env FACEBOOK_ID=id -a ' + this.deployedName + '\n\t') +
254+
chalk.bold('rhc set-env FACEBOOK_SECRET=secret -a ' + this.deployedName + '\n')));
255+
hasWarning = true;
251256
}
252257
if(this.filters.googleAuth) {
253-
this.log(chalk.yellow('Google auth requires you to set environment variables for\n\t' + 'GOOGLE-APP-ID\n\t' + 'GOOGLE-SECRET'));
254-
258+
this.log(chalk.yellow('You will need to set environment variables for google auth:\n\t' +
259+
chalk.bold('rhc set-env GOOGLE_ID=id -a ' + this.deployedName + '\n\t') +
260+
chalk.bold('rhc set-env GOOGLE_SECRET=secret -a ' + this.deployedName + '\n')));
261+
hasWarning = true;
255262
}
256263
if(this.filters.twitterAuth) {
257-
this.log(chalk.yellow('Twitter auth requires you to set environment variables for\n\t' + 'TWITTER-APP-ID\n\t' + 'TWITTER-SECRET'));
264+
this.log(chalk.yellow('You will need to set environment variables for twitter auth:\n\t' +
265+
chalk.bold('rhc set-env TWITTER_ID=id -a ' + this.deployedName + '\n\t') +
266+
chalk.bold('rhc set-env TWITTER_SECRET=secret -a ' + this.deployedName + '\n')));
267+
hasWarning = true;
258268
}
259269

260270
this.log(chalk.green('\nYour app should now be live at \n\t' + chalk.bold(host_url)));
271+
if(hasWarning) {
272+
this.log(chalk.green('\nYou may need to address the issues mentioned above and restart the server for the app to work correctly \n\t' +
273+
'rhc app-restart -a ' + this.deployedName));
274+
}
261275
this.log(chalk.yellow('After app modification run\n\t' + chalk.bold('grunt build') +
262276
'\nThen enter the dist folder to commit these updates:\n\t' + chalk.bold('cd dist && git add -A && git commit -m "describe your changes here"')));
263277
this.log(chalk.green('Finally, deploy your updated build to OpenShift with\n\t' + chalk.bold('git push -f '+this.deployedName+' master')));

0 commit comments

Comments
 (0)