master
pan 4 years ago
parent aee534fc8a
commit 28ecf02db9
  1. 5
      routes/index.js

@ -8,6 +8,8 @@ router.post('/server', function(req, res, next) {
const updated_at=req.body.repository.updated_at
console.info('调用自动部署命令')
const promise = new Promise((resolve, reject) => {
const spawnObj = spawn('updateRisk', ['RiskCloudMock'], {encoding: 'utf-8'});
spawnObj.stdout.on('data', function(chunk) {
console.log(chunk.toString());
@ -20,8 +22,11 @@ router.post('/server', function(req, res, next) {
})
spawnObj.on('exit', (code) => {
console.log('exit code : ' + code);
resolve(true)
})
})
res.json({message:`仓库代码${req.body.repository.ssh_url}部署中`})
});

Loading…
Cancel
Save