|
|
|
@ -58,10 +58,7 @@ router.post('/deploy', function(req, res, next) { |
|
|
|
|
info(updated_at) |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
startDeploy[name] = { |
|
|
|
|
startTime: moment(), |
|
|
|
|
description: description |
|
|
|
|
} |
|
|
|
|
const startTime=moment() |
|
|
|
|
|
|
|
|
|
dingding(`开始自动部署${name}|${description},更新日志:${commitsMsg}`) |
|
|
|
|
|
|
|
|
@ -75,6 +72,9 @@ router.post('/deploy', function(req, res, next) { |
|
|
|
|
}); |
|
|
|
|
spawnObj.on('close', function (code) { |
|
|
|
|
info('close code : ' + code); |
|
|
|
|
|
|
|
|
|
dingding(`${name}|${description}自动部署成功,花费时间:${moment().diff(startTime, 'seconds', true)}秒`) |
|
|
|
|
res.json({message:`仓库代码${name}部署成功`}) |
|
|
|
|
}) |
|
|
|
|
spawnObj.on('exit', (code) => { |
|
|
|
|
info('exit code : ' + code); |
|
|
|
@ -91,19 +91,6 @@ router.post('/deploy', function(req, res, next) { |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
//部署完毕事件
|
|
|
|
|
router.post('/finsh', function(req, res, next) { |
|
|
|
|
if(req.body.name in startDeploy) { |
|
|
|
|
let deployInfo=startDeploy[req.body.name] |
|
|
|
|
dingding(`${req.body.name}|${deployInfo.description}自动部署成功,花费时间:${moment().diff(deployInfo.startTime, 'seconds', true)}秒`) |
|
|
|
|
res.json({message:`仓库代码${req.body.name}部署成功`}) |
|
|
|
|
}else { |
|
|
|
|
let msg='参数异常,无法试别部署完毕事件' |
|
|
|
|
error(msg) |
|
|
|
|
res.json({msg}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
//部署期间显示部署页面
|
|
|
|
|
router.get('/', function(req, res, next) { |
|
|
|
|