diff --git a/src/rest/autodeploy/download.js b/src/rest/autodeploy/download.js index 61b603c..b732e76 100644 --- a/src/rest/autodeploy/download.js +++ b/src/rest/autodeploy/download.js @@ -10,7 +10,7 @@ module.exports = { dbUtils.query(sql).then(res => { let info = res?.[0] if (info?.id) { - let path = `zips/${info.id}/dist`, zipPath = `./zips/${info.id}.zip` + let path = `${info.target}`, zipPath = `./zips/${info.id}.zip` fse.removeSync(zipPath) fse.pathExists(path, (err, exists) => { console.log(`${path}=========>${exists}`) diff --git a/src/rest/autodeploy/getZip.js b/src/rest/autodeploy/getZip.js index c186e37..2672f02 100644 --- a/src/rest/autodeploy/getZip.js +++ b/src/rest/autodeploy/getZip.js @@ -20,7 +20,7 @@ module.exports = { console.log(err) db.query(`update node_autodeploy set error='${err}' where id='${info.id}'`) }) - } else response.send({code: 1, err: "无法找到git信息"}) + } else response.send({code: 1, err: "无法找到部署工程"}) }).catch(err => { console.log(err) response.send({code: 1, err: err.sqlMessage}) diff --git a/src/tools/zipProject.js b/src/tools/zipProject.js index e2afbc0..3e3c8f6 100644 --- a/src/tools/zipProject.js +++ b/src/tools/zipProject.js @@ -4,9 +4,8 @@ module.exports = info => { return new Promise((resolve, reject) => { fse.emptyDir(`zips/${info.id}`, err => { if (!err) { - execute(`cd zips&&git clone ${info.git} ./${info.id}`) - .then(() => execute(`cd zips/${info.id}&&git checkout ${info.branch}`)) - .then(() => execute(`cd zips/${info.id}&&npm i&&npm run build`)) + execute(`./${info.updateShell}`) + .then(() => execute(`./${info.libShell}`)) .then(() => resolve()) .catch(errs => { console.log(errs)