Skip to content

Instantly share code, notes, and snippets.

@mplewis
Last active January 3, 2016 10:09
Show Gist options
  • Save mplewis/8447587 to your computer and use it in GitHub Desktop.
Save mplewis/8447587 to your computer and use it in GitHub Desktop.
Hook to Deploy config for Docker deploys
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