Compare commits
4 Commits
99331d5b8d
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c335d97a3f | ||
|
|
456e55bb2e | ||
|
|
8586b76ef2 | ||
|
|
3767f1938a |
@@ -7,4 +7,6 @@ RUN npm i --registry=http://registry.npmmirror.com
|
||||
|
||||
EXPOSE 12525
|
||||
|
||||
ENV TZ=Asia/Shanghai
|
||||
|
||||
CMD ["node", "index.js"]
|
||||
|
||||
@@ -3,10 +3,10 @@ module.exports = {
|
||||
action: "/node/custom/addOrUpdate",
|
||||
method: "post",
|
||||
execute: (request, response) => {
|
||||
let {id, name, type, customPath, apps, createTime, dist, version, zipTime, download, error, extra} = request.body
|
||||
let {id, name, type, customPath, apps, createTime, dist, version, zipTime, download, error, extra,webhook} = request.body
|
||||
dbUtils.addOrUpdate({
|
||||
table: 'node_custom_config',
|
||||
form: {id, name, type, customPath, apps, createTime, dist, version, zipTime, download, error, extra}
|
||||
form: {id, name, type, customPath, apps, createTime, dist, version, zipTime, download, error, extra,webhook}
|
||||
}).then(data => {
|
||||
response.send({code: 0, data})
|
||||
}).catch(err => {
|
||||
|
||||
@@ -14,7 +14,7 @@ module.exports = {
|
||||
> 发布版本:${info.version}
|
||||
> 打包完成时间:${info.download}`
|
||||
}
|
||||
}, {params: {key: "a5971027-2dd3-4c23-a4e4-c99a962d25a7",}}).then(res => {
|
||||
}, {params: {key: info.webhook || "a5971027-2dd3-4c23-a4e4-c99a962d25a7",}}).then(res => {
|
||||
response.send({code: 0, msg: res.data})
|
||||
})
|
||||
} else response.send({code: 1, err: "无法找到项目信息"})
|
||||
|
||||
@@ -61,7 +61,7 @@ const handleZip = (id, ws) => {
|
||||
const {signal} = controller;
|
||||
const progress = new counter(`正在处理 ${info.name} 的打包工作...`)
|
||||
if (['web','wxwork'].includes(info.type)) {
|
||||
const {name, version, dist} = info
|
||||
const {name, version, dist,webhook} = info
|
||||
const deploy = dist?.trim() || `${name}v${version}`
|
||||
const buildConfig = {
|
||||
web: {task: "devops-web", token: 'fLeOGSVIRs405Me'},
|
||||
@@ -72,7 +72,7 @@ const handleZip = (id, ws) => {
|
||||
.then(() => progress.set(30, id))
|
||||
.then(() => fse.emptyDir(dist || `../zips/${deploy}`))
|
||||
.then(() => http.get(`/view/devops/job/${buildConfig.task}/api/json`).then(res => currentJob = (res.data?.nextBuildNumber || 1)))
|
||||
.then(() => http.get(`/view/devops/job/${buildConfig.task}/buildWithParameters`, {params: {token: buildConfig.token, pid: id, dist: deploy}}))
|
||||
.then(() => http.get(`/view/devops/job/${buildConfig.task}/buildWithParameters`, {params: {token: buildConfig.token, pid: id, dist: deploy,webhook}}))
|
||||
.then(() => new Promise((resolve, reject) => {
|
||||
jobs[id] = {task: buildConfig.task, build: currentJob}
|
||||
const timer = setInterval(() => {
|
||||
|
||||
Reference in New Issue
Block a user