@taole/deploy-helper 1.2.9 → 1.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.mjs +12 -4
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -230,7 +230,7 @@ async function main() {
230
230
  console.log(`command: scp {subdir/file} OfficialSite目录下仅放开admin子目录, 如scp admin/xxx.htm`);
231
231
  console.log(`command: scpevt {file} 复制文件{file}到events测试服务器{file}`);
232
232
  console.log(`command: scpevt {file} {dest} 复制文件{file}到events测试服务器{dest}`);
233
- console.log(`command: pipeline {pipelineName|pipelineId} [branch] 触发流水线{pipelineName|pipelineId} 指定分支(可省略)`);
233
+ console.log(`command: pipeline {pipelineName|pipelineId} [branch] [--trigger-only] 触发流水线{pipelineName|pipelineId},指定分支可省略;加 --trigger-only 则只触发不等待结果`);
234
234
  Object.keys(commandMap).forEach(command => {
235
235
  const cmdObj = commandMap[command];
236
236
  if (!cmdObj.help) return;
@@ -319,13 +319,21 @@ async function main() {
319
319
  process.exit(0);
320
320
  } else if (command === "pipeline") {
321
321
  const pipelineName = process.argv[3];
322
- if (!pipelineName) {
322
+ if (!pipelineName || pipelineName.startsWith("-")) {
323
323
  log(`pipeline参数不能为空`);
324
324
  process.exit(1);
325
325
  }
326
- const branch = process.argv[4] || "";
326
+ const rest = process.argv.slice(4);
327
+ const triggerOnly = rest.includes("--trigger-only");
328
+ const branch = rest.find((arg) => !String(arg).startsWith("-")) || "";
327
329
  try {
328
- await triggerPipeline(pipelineName, { waitResult: true, branch });
330
+ await triggerPipeline(pipelineName, {
331
+ waitResult: !triggerOnly,
332
+ branch,
333
+ });
334
+ if (triggerOnly) {
335
+ log(`已按 --trigger-only 退出(不等待流水线执行结果)`);
336
+ }
329
337
  process.exit(0);
330
338
  } catch (error) {
331
339
  log(`触发流水线失败: `, error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taole/deploy-helper",
3
- "version": "1.2.9",
3
+ "version": "1.2.10",
4
4
  "description": "脚本部署工具,用于将项目部署到测试环境或生产环境",
5
5
  "main": "index.mjs",
6
6
  "type": "module",