Last active
January 3, 2016 10:09
-
-
Save mplewis/8447587 to your computer and use it in GitHub Desktop.
Hook to Deploy config for Docker deploys
This file contains hidden or 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 util = require('util'); | |
var port = 4728; | |
var hooks = { | |
helloworld: { | |
key: 'DEADBEEFCAFE', | |
action: function(req, res) { | |
var to_exec = '../deploy-scripts/deploy-helloworld.sh'; | |
require('child_process').exec(to_exec, function(error, stdout, stderr) { | |
var retval = {}; | |
retval.stdout = stdout.split('\n'); | |
retval.stderr = stderr.split('\n'); | |
if (error === null) { | |
retval.success = true; | |
res.send(200, retval); | |
} else { | |
retval.error = error; | |
res.send(500, retval); | |
} | |
}); | |
} | |
} | |
}; | |
module.exports = { | |
port: port, | |
hooks: hooks | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment