Skip to content

Commit

Permalink
add deploy command
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMabuse23 committed Oct 31, 2014
1 parent 4390892 commit a8b09ac
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
34 changes: 34 additions & 0 deletions lib/deploy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* Created by pascalbrewing on 30/10/14.
*/
'use strict';
var chalk = require('chalk');
var mcapDeploy = require('mcap-deploy');
var _ = require('lodash');

function deploy(config) {

if (!config) {
return;
}
console.log('config', config);
mcapDeploy.deploy(config).then(function (data) {
var baseUrl = data.endpoint + config.baseAlias + '/';
console.log(baseUrl,'test then');
_.each(data.response.error, function (msg) {
console.log(chalk.red(msg));
});
_.each(data.response.verbose, function (msg) {
console.log(chalk.cyan(msg));
});
_.each(data.response.info, function (msg) {
console.log(chalk.yellow(msg));
});
console.log(chalk.green('Your application is now available!'));
console.log(chalk.gray('Client:'), chalk.underline(baseUrl + 'index.html'));
console.log(chalk.gray('API:'), chalk.underline(baseUrl + 'api/'));
}).catch(function (e) {
console.log(chalk.red(e));
});
}
module.exports.deploy = deploy;
3 changes: 2 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
'use strict';

module.exports = {
createProject: require('./create-project.js')
createProject: require('./create-project.js'),
deploy: require('./deploy.js')
};
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"yeoman-environment": "^1.0.2"
},
"devDependencies": {
"chalk": "^0.5.1",
"coveralls": "^2.11.1",
"gulp": "^3.8.8",
"gulp-bump": "^0.1.11",
Expand All @@ -36,6 +37,7 @@
"gulp-plumber": "^0.6.5",
"gulp-util": "^3.0.1",
"jshint-stylish": "^0.4.0",
"mcap-deploy": "^0.2.0",
"mkdirp": "^0.5.0",
"rimraf": "^2.2.8",
"should": "^4.0.4",
Expand Down

0 comments on commit a8b09ac

Please sign in to comment.