|
|
@ -51,6 +51,8 @@ router.post('/deploy', function(req, res, next) { |
|
|
|
//仓库描述信息
|
|
|
|
//仓库描述信息
|
|
|
|
const description=req.body.repository.description |
|
|
|
const description=req.body.repository.description |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
startDeploy[name] = { |
|
|
|
startDeploy[name] = { |
|
|
|
startTime: moment(updated_at), |
|
|
|
startTime: moment(updated_at), |
|
|
|
description: description |
|
|
|
description: description |
|
|
@ -77,12 +79,17 @@ router.post('/deploy', function(req, res, next) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.json({message: `仓库代码${req.body.repository.ssh_url}部署中`}) |
|
|
|
res.json({message: `仓库代码${req.body.repository.ssh_url}部署中`}) |
|
|
|
|
|
|
|
} catch (e) { |
|
|
|
|
|
|
|
error(e) |
|
|
|
|
|
|
|
res.json({message: `仓库代码${req.body.repository.ssh_url}部署出现异常`}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
//部署完毕事件
|
|
|
|
//部署完毕事件
|
|
|
|
router.get('/finsh', function(req, res, next) { |
|
|
|
router.get('/finsh', function(req, res, next) { |
|
|
|
dingding(`${req.query.name}|${startDeploy[req.query.name].description}自动部署成功,
|
|
|
|
dingding(`${req.query.name}|${startDeploy[req.query.name].description}自动部署成功,
|
|
|
|
花费时间:${moment().diff(startDeploy[req.query.name].startTime,'seconds')}`)
|
|
|
|
花费时间:${moment().diff(startDeploy[req.query.name].startTime,'seconds')}秒`)
|
|
|
|
res.json({message:`仓库代码${req.query.name}部署成功`}) |
|
|
|
res.json({message:`仓库代码${req.query.name}部署成功`}) |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|