feat(devops): 为 web 和 wxwork 类型的打包任务添加 webhook 支持
- 在打包信息中增加了 webhook 字段 - 更新了构建配置参数,将 webhook 传递给 Jenkins 构建任务
This commit is contained in:
@@ -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