Created
August 20, 2014 18:54
-
-
Save danemacaulay/92787cc336171d3aceae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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