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