代码拉取完成,页面将自动刷新
var http = require('http');
var exec = require('shelljs').exec;
const PORT = 6603;
console.log('listening port at: ' + PORT);
const cmds = {
'service/users': 'cd /mnt/authing/users && git pull',
'service/emails': 'cd /mnt/authing/emails && git pull',
'service/pay': 'cd /mnt/authing/pay && git pull',
'service/oauth': 'cd /mnt/authing/oauth && git pull',
client: 'cd /mnt/authing/client && git pull'
};
console.log(cmds);
var deployServer = http.createServer(function(request, response) {
// var inCMDs = false,
// cmd = '';
// for (var key in cmds) {
// if (key == request.url) {
// inCMDs = true;
// cmd = cmds[key];
// break;
// }
// }
// if (inCMDs) {
// exec(cmd, function(err, out, code) {
// if (err instanceof Error) {
// response.writeHead(500);
// response.end('Server Internal Error.');
// throw err;
// }
// process.stderr.write(err.toString());
// process.stdout.write(out.toString());
// response.writeHead(200);
// response.end('Deploy Done.');
// });
// } else {
// response.writeHead(404);
// response.end('Invalid Deploy Request');
// }
console.log(request)
});
deployServer.listen(PORT);
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。