From d9cb2f63f0dc782cc6825d9317b9d70cc43defbf Mon Sep 17 00:00:00 2001 From: pan <1029559041@qq.com> Date: Sat, 10 Oct 2020 02:12:40 +0800 Subject: [PATCH] init --- routes/index.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/routes/index.js b/routes/index.js index fa8a866..907af50 100644 --- a/routes/index.js +++ b/routes/index.js @@ -7,13 +7,15 @@ router.post('/server', function(req, res, next) { const updated_at=req.body.repository.updated_at + const shell='nohup updateRisk RiskCloudMock &' // 输出当前目录(不一定是代码所在的目录)下的文件和文件夹 - exec('nohup updateRisk RiskCloudMock &', (err, stdout, stderr) => { + console.log(`开始执行shell:${shell}`) + exec(shell, (err, stdout, stderr) => { if(err) { - console.info(err) + console.log(err) res.json({message:'自动部署服务端失败'}) }else { - console.info(stdout) + console.log(stdout) res.json({message: `开始自动部署服务端,版本号:${updated_at}`}) } @@ -24,7 +26,6 @@ router.post('/server', function(req, res, next) { //部署完毕事件 router.get('/finsh', function(req, res, next) { - res.json({message:`仓库代码${req.query.name}部署成功`}) });