@docupace/pipeline 1.0.6-alpha.3 → 1.0.6-alpha.5
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.
- package/package.json +1 -1
- package/src/next/cli.js +4 -3
- package/src/next/pipline.js +13 -1
package/package.json
CHANGED
package/src/next/cli.js
CHANGED
|
@@ -112,13 +112,14 @@ program
|
|
|
112
112
|
return { ...previous, [key]: val };
|
|
113
113
|
},
|
|
114
114
|
{},
|
|
115
|
-
)
|
|
115
|
+
)
|
|
116
|
+
.option('-w, --wait', 'Wait for the pipeline to complete', false) // Defaults to false
|
|
116
117
|
.action(async (cmdObj) => {
|
|
117
118
|
try {
|
|
118
|
-
const { repository, pipelineName, branch, variables } = cmdObj;
|
|
119
|
+
const { repository, pipelineName, branch, variables, wait } = cmdObj;
|
|
119
120
|
|
|
120
121
|
// Call the triggerPipelineByName function
|
|
121
|
-
await runPipeline(repository, pipelineName, branch, variables);
|
|
122
|
+
await runPipeline(repository, pipelineName, branch, variables, wait);
|
|
122
123
|
} catch (error) {
|
|
123
124
|
console.error('Error triggering pipeline:', error.message);
|
|
124
125
|
process.exit(1);
|
package/src/next/pipline.js
CHANGED
|
@@ -67,7 +67,13 @@ async function getPipelineStatus(repository, pipelineUUID) {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
export async function runPipeline(
|
|
70
|
+
export async function runPipeline(
|
|
71
|
+
repository,
|
|
72
|
+
pipelineName,
|
|
73
|
+
branch,
|
|
74
|
+
variables,
|
|
75
|
+
wait,
|
|
76
|
+
) {
|
|
71
77
|
try {
|
|
72
78
|
console.log(
|
|
73
79
|
`Triggering custom pipeline: ${pipelineName} for branch: ${branch}...`,
|
|
@@ -77,7 +83,13 @@ export async function runPipeline(repository, pipelineName, branch, variables) {
|
|
|
77
83
|
pipelineName,
|
|
78
84
|
branch,
|
|
79
85
|
variables,
|
|
86
|
+
(wait = false),
|
|
80
87
|
);
|
|
88
|
+
|
|
89
|
+
if (!wait) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
|
|
81
93
|
const pipelineUUID = pipeline.uuid;
|
|
82
94
|
|
|
83
95
|
console.log(`Pipeline triggered with UUID: ${pipelineUUID}`);
|