Skip to content

Instantly share code, notes, and snippets.

@danemacaulay
Created August 20, 2014 18:54
Show Gist options
  • Save danemacaulay/92787cc336171d3aceae to your computer and use it in GitHub Desktop.
Save danemacaulay/92787cc336171d3aceae to your computer and use it in GitHub Desktop.
var exec = require('child_process').exec,
fs = require('fs'),
path = require('path'),
winston = require('winston'),
projects;
fs.writeFileSync('build.log', '');
winston.add(winston.transports.File, { filename: 'build.log' });
projects = [
'batchcoordinator',
'common',
'commonrestclient',
'content',
'crmadapterclient',
'dnb360dynamicsifdproxy',
'dnbdirectclient',
'dnbservices',
'entitlement',
'hostedstorage',
'informaticabatchclient',
'maxcvclient',
'purchasedcontactsservice',
'sapproxy',
'storage',
'uiagent',
];
projects.forEach(function (project) {
var dir = path.dirname(__dirname).concat(path.sep, project);
if (fs.existsSync(dir)) {
exec('git stash', {cwd: dir}, logger);
exec('git pull', {cwd: dir}, logger);
exec('ant publish && ant deploy', {cwd: dir}, logger);
exec('git stash pop', {cwd: dir}, logger);
}
})
function logger(error, stdout, stderr){
winston.log('info', stdout);
winston.log('debug', stderr);
if (error !== null) {
winston.log('error', error);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment