@docupace/pipeline 1.0.48 → 1.0.49

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 (43) hide show
  1. package/.prettierrc.cjs +12 -12
  2. package/README.md +135 -135
  3. package/bin/azuread_update_callbacks_for_app.sh +58 -58
  4. package/bin/next-changeset-validate.sh +8 -8
  5. package/next/changeset.sh +75 -75
  6. package/next/copy.sh +34 -34
  7. package/next/deploy.sh +40 -40
  8. package/next/execute.sh +123 -123
  9. package/next/sonar.sh +23 -23
  10. package/package.json +1 -1
  11. package/src/auth0/alias.js +72 -72
  12. package/src/auth0/configure.js +783 -783
  13. package/src/auth0/export.js +43 -43
  14. package/src/auth0/metadata.js +132 -132
  15. package/src/auth0/vault.js +107 -107
  16. package/src/changeset/changeset-config.js +34 -34
  17. package/src/changeset/cli.js +188 -188
  18. package/src/changeset/create.js +205 -205
  19. package/src/changeset/package-util.js +86 -86
  20. package/src/changeset/util.js +43 -43
  21. package/src/changeset/validate.js +84 -84
  22. package/src/changeset/version.js +95 -95
  23. package/src/jenkins/setParams.groovy +58 -58
  24. package/src/next/alias.js +53 -53
  25. package/src/next/apache.js +73 -73
  26. package/src/next/cli.js +220 -220
  27. package/src/next/config.js +100 -136
  28. package/src/next/connect.js +227 -227
  29. package/src/next/copy.js +61 -61
  30. package/src/next/deploy.js +553 -553
  31. package/src/next/haproxy.js +71 -71
  32. package/src/next/jira.js +80 -80
  33. package/src/next/logger.js +17 -17
  34. package/src/next/pipline.js +114 -114
  35. package/src/next/publish.js +71 -71
  36. package/src/next/pull.js +7 -7
  37. package/src/next/sonar.js +23 -23
  38. package/src/next/util.js +93 -93
  39. package/src/next/vault.js +45 -45
  40. package/terraform/apply.sh +37 -37
  41. package/terraform/init.sh +72 -72
  42. package/terraform/plan.sh +76 -76
  43. package/terraform/validate.sh +17 -17
@@ -1,73 +1,73 @@
1
- import fs from 'fs-extra';
2
- import { $ } from 'zx';
3
-
4
- function log(msg) {
5
- console.log(`[*] ${msg}`);
6
- }
7
-
8
- export async function addApacheSite() {
9
- if (
10
- !process.env.ENVIRONMENT ||
11
- !['dev', 'qa', 'uat', 'stage','www3'].includes(process.env.ENVIRONMENT)
12
- ) {
13
- log('Error: wront ENVIRONMENT');
14
- process.exit(1);
15
- }
16
- if (!process.env.SITE) {
17
- log('Error: SITE cannot be empty.');
18
- process.exit(1);
19
- }
20
-
21
- const apacheEnvHostMap = {
22
- dev: {
23
- host1: 'dev-apalb01a.corp.docupace.com',
24
- host2: 'dev-apalb01b.corp.docupace.com',
25
- repo: 'iis-preprod',
26
- },
27
- qa: {
28
- host1: 'qa-apalb01a.corp.docupace.com',
29
- host2: 'qa-apalb01b.corp.docupace.com',
30
- repo: 'iis-preprod',
31
- },
32
- uat: {
33
- host1: 'uat-apalb01a.edc.docupace.internal',
34
- host2: 'uat-apalb01b.edc.docupace.internal',
35
- repo: 'iis-www2',
36
- },
37
- stage: {
38
- host1: 'stg-apalb01a.edc.docupace.internal',
39
- host2: 'stg-apalb01b.edc.docupace.internal',
40
- repo: 'iis-www2',
41
- },
42
- www3: {
43
- host1: 'prd-apalb05a.edc.docupace.internal',
44
- host2: 'prd-apalb05b.edc.docupace.internal',
45
- repo: 'iis-www2',
46
- },
47
- };
48
-
49
- // Save private key from base64
50
- const haproxyPrivateKey = process.env.HAPROXY_PRIVATE_KEY;
51
- if (!haproxyPrivateKey) {
52
- log('Error: HAPROXY_PRIVATE_KEY not set.');
53
- process.exit(1);
54
- }
55
-
56
- await fs.writeFile('private.key', Buffer.from(haproxyPrivateKey, 'base64'));
57
- await fs.chmod('private.key', 0o600);
58
-
59
- console.log('Running command');
60
- const sshCmd = (server, script) =>
61
- $`ssh -i private.key -o StrictHostKeyChecking=no root@${server} ${script}`;
62
-
63
- // The script is run twice in the Bash version
64
- await sshCmd(
65
- apacheEnvHostMap[process.env.ENVIRONMENT].host1,
66
- `/root/repo/${apacheEnvHostMap[process.env.ENVIRONMENT].repo}/scripts/addsite/add_core_site.sh ${process.env.ENVIRONMENT} ${process.env.SITE}`,
67
- );
68
-
69
- await sshCmd(
70
- apacheEnvHostMap[process.env.ENVIRONMENT].host2,
71
- `/root/repo/${apacheEnvHostMap[process.env.ENVIRONMENT].repo}/scripts/addsite/add_core_site.sh ${process.env.ENVIRONMENT} ${process.env.SITE}`,
72
- );
73
- }
1
+ import fs from 'fs-extra';
2
+ import { $ } from 'zx';
3
+
4
+ function log(msg) {
5
+ console.log(`[*] ${msg}`);
6
+ }
7
+
8
+ export async function addApacheSite() {
9
+ if (
10
+ !process.env.ENVIRONMENT ||
11
+ !['dev', 'qa', 'uat', 'stage','www3'].includes(process.env.ENVIRONMENT)
12
+ ) {
13
+ log('Error: wront ENVIRONMENT');
14
+ process.exit(1);
15
+ }
16
+ if (!process.env.SITE) {
17
+ log('Error: SITE cannot be empty.');
18
+ process.exit(1);
19
+ }
20
+
21
+ const apacheEnvHostMap = {
22
+ dev: {
23
+ host1: 'dev-apalb01a.corp.docupace.com',
24
+ host2: 'dev-apalb01b.corp.docupace.com',
25
+ repo: 'iis-preprod',
26
+ },
27
+ qa: {
28
+ host1: 'qa-apalb01a.corp.docupace.com',
29
+ host2: 'qa-apalb01b.corp.docupace.com',
30
+ repo: 'iis-preprod',
31
+ },
32
+ uat: {
33
+ host1: 'uat-apalb01a.edc.docupace.internal',
34
+ host2: 'uat-apalb01b.edc.docupace.internal',
35
+ repo: 'iis-www2',
36
+ },
37
+ stage: {
38
+ host1: 'stg-apalb01a.edc.docupace.internal',
39
+ host2: 'stg-apalb01b.edc.docupace.internal',
40
+ repo: 'iis-www2',
41
+ },
42
+ www3: {
43
+ host1: 'prd-apalb05a.edc.docupace.internal',
44
+ host2: 'prd-apalb05b.edc.docupace.internal',
45
+ repo: 'iis-www2',
46
+ },
47
+ };
48
+
49
+ // Save private key from base64
50
+ const haproxyPrivateKey = process.env.HAPROXY_PRIVATE_KEY;
51
+ if (!haproxyPrivateKey) {
52
+ log('Error: HAPROXY_PRIVATE_KEY not set.');
53
+ process.exit(1);
54
+ }
55
+
56
+ await fs.writeFile('private.key', Buffer.from(haproxyPrivateKey, 'base64'));
57
+ await fs.chmod('private.key', 0o600);
58
+
59
+ console.log('Running command');
60
+ const sshCmd = (server, script) =>
61
+ $`ssh -i private.key -o StrictHostKeyChecking=no root@${server} ${script}`;
62
+
63
+ // The script is run twice in the Bash version
64
+ await sshCmd(
65
+ apacheEnvHostMap[process.env.ENVIRONMENT].host1,
66
+ `/root/repo/${apacheEnvHostMap[process.env.ENVIRONMENT].repo}/scripts/addsite/add_core_site.sh ${process.env.ENVIRONMENT} ${process.env.SITE}`,
67
+ );
68
+
69
+ await sshCmd(
70
+ apacheEnvHostMap[process.env.ENVIRONMENT].host2,
71
+ `/root/repo/${apacheEnvHostMap[process.env.ENVIRONMENT].repo}/scripts/addsite/add_core_site.sh ${process.env.ENVIRONMENT} ${process.env.SITE}`,
72
+ );
73
+ }
package/src/next/cli.js CHANGED
@@ -1,220 +1,220 @@
1
- #!/usr/bin/env node
2
-
3
- import { Command } from 'commander';
4
- import { pull } from './pull.js';
5
- import { sonar } from './sonar.js';
6
- import { publish } from './publish.js';
7
- import {
8
- deployAppWithTag,
9
- deployFromSite,
10
- deployTemplate,
11
- getDefaultDeploySite,
12
- getDeployTag,
13
- } from './deploy.js';
14
- import { copy, copy2 } from './copy.js';
15
- import { vaultAddSiteData } from './vault.js';
16
- import { addApacheSite } from './apache.js';
17
- import { haproxySync } from './haproxy.js';
18
- import { connectClone } from './connect.js';
19
- import dotenv from 'dotenv';
20
- import { $ } from 'zx';
21
- import { deployConnect, deployCore } from './jenkins.js';
22
- import { runPipeline } from './pipline.js';
23
-
24
- dotenv.config({ path: ['.env.pipeline.local', 'config/.env.pipeline.local'] });
25
-
26
- const program = new Command();
27
-
28
- const GIT_SHA = (await $`git log --pretty=format:'%h' -n 1`).stdout.trim();
29
-
30
- program
31
- .command('pull <imageName>')
32
- .description('Pull a Docker image from the registry')
33
- .action(async (imageName) => {
34
- await pull(imageName);
35
- });
36
-
37
- program
38
- .command('sonar')
39
- .description('Run Sonar analysis')
40
- .action(async () => {
41
- await sonar(GIT_SHA);
42
- });
43
-
44
- program
45
- .command('addApacheSite')
46
- .description('Add site to apache')
47
- .action(async () => {
48
- await addApacheSite();
49
- });
50
-
51
- program
52
- .command('connectClone')
53
- .description('Clone connect site')
54
- .action(async () => {
55
- await connectClone();
56
- });
57
-
58
- program
59
- .command('haproxySync')
60
- .description('Sync haproxy config')
61
- .action(async () => {
62
- await haproxySync();
63
- });
64
-
65
- program
66
- .command('vaultAddSiteData')
67
- .description('Add m2m auth0 data to vault')
68
- .requiredOption('-s, --site-name <siteName>', 'Site name')
69
- .requiredOption(
70
- '-p, --site-config-remote-path <siteConfigRemotePath>',
71
- 'Site Config Remote Path',
72
- )
73
- .action(async (options) => {
74
- const { siteName, siteConfigRemotePath } = options;
75
- await vaultAddSiteData(siteName, siteConfigRemotePath);
76
- });
77
-
78
- program
79
- .command('publish')
80
- .description('Publish a Docker image')
81
- .action(async () => {
82
- await publish(GIT_SHA);
83
- });
84
-
85
- program
86
- .command('deploy-from-site')
87
- .description('Deploy an application for a specific site')
88
- .requiredOption('-f, --from-env <fromEnv>', 'Source environment')
89
- .requiredOption('-t, --to-env <toEnv>', 'Target environment')
90
- .requiredOption('-F, --from-site <fromSite>', 'Source site')
91
- .requiredOption('-T, --to-site <toSite>', 'Target site')
92
- .option('-c, --deploy-core <deployCore>', 'Deploy Core', 'false')
93
- .option('-C, --deploy-connect <deployConnect>', 'Deploy Connect', 'false')
94
- .action(async (options) => {
95
- const { fromEnv, fromSite, toEnv, toSite, deployCore, deployConnect } =
96
- options;
97
- await deployFromSite(
98
- fromEnv,
99
- fromSite,
100
- toEnv,
101
- toSite,
102
- deployCore,
103
- deployConnect,
104
- );
105
- });
106
-
107
- program
108
- .command('deploy-template <tagPrefix>')
109
- .description('Deploy an application for a specific site')
110
- .action(async (tagPrefix) => {
111
- const deployTag = await getDeployTag(tagPrefix);
112
- const { env, site } = await getDefaultDeploySite(deployTag);
113
- await deployTemplate(env, site, deployTag);
114
- });
115
-
116
- program
117
- .command('deployTemplate')
118
- .description('Deploy an application for a specific site')
119
- .action(async () => {
120
- const deployTag = await getDeployTag();
121
- const { env, site } = await getDefaultDeploySite(deployTag);
122
- await deployTemplate(env, site, deployTag);
123
- });
124
-
125
- program
126
- .command('deploy-app <application>')
127
- .description('Deploy an application for a specific site')
128
- .action(async (application) => {
129
- const deployTag = await getDeployTag();
130
- const { env, site } = await getDefaultDeploySite(deployTag);
131
- await deployAppWithTag(application, env, site, deployTag);
132
- });
133
-
134
- program
135
- .command('deploy-mono-app <tag> <application>')
136
- .description('Deploy an application for a specific site')
137
- .action(async (tag, application) => {
138
- const deployTag = await getDeployTag(tag);
139
- const version = 'v' + deployTag.split('@')[1];
140
- const { env, site } = await getDefaultDeploySite(version);
141
- await deployAppWithTag(application, env, site, version);
142
- });
143
-
144
- program
145
- .command('deploy-core <env> <site>')
146
- .description('Deploy Core')
147
- .option('-l, --liquibase <liquibase>', 'Application name', 'true')
148
- .option('-b, --branch <branch>', 'Branch', 'master')
149
- .action(async (env, site, options) => {
150
- await deployCore(env, site, options.liquibase, options.branch);
151
- });
152
-
153
- program
154
- .command('deploy-connect <env> <site>')
155
- .description('Deploy Core')
156
- .option('-l, --liquibase <liquibase>', 'Application name', 'true')
157
- .option('-b, --branch <branch>', 'Branch', 'master')
158
- .action(async (env, site, options) => {
159
- await deployConnect(env, site, options.liquibase, options.branch);
160
- });
161
-
162
- program
163
- .command('deploy-core-pipeline <env> <site>')
164
- .description('Deploy Core')
165
- .option('-l, --liquibase <liquibase>', 'Application name', 'true')
166
- .option('-b, --branch <branch>', 'Branch', 'master')
167
- .action(async (env, site, options) => {
168
- await runPipeline('site-deploy', 'deploy-core', 'main', {
169
- ENV: env,
170
- SITE: site,
171
- LIQUIBASE: options.liquibase,
172
- BRANCH: options.branch,
173
- });
174
- });
175
-
176
- program
177
- .command('copy')
178
- .description('Copy a Docker image between registries')
179
- .requiredOption('-r, --repository <repository>', 'Repostory name')
180
- .requiredOption('-f, --from-env <fromEnv>', 'Source environment')
181
- .requiredOption('-t, --to-env <toEnv>', 'Target environment')
182
- .requiredOption('-g, --tag <tag>', 'Image tag')
183
- .requiredOption('-a, --application <application>', 'Application name')
184
- .action(async (options) => {
185
- const { repository, fromEnv, toEnv, tag, application } = options;
186
- await copy2(repository, fromEnv, toEnv, tag, application);
187
- });
188
-
189
- program
190
- .command('run-pipeline')
191
- .description('Trigger a pipeline by name')
192
- .requiredOption('-r, --repository <repository>', 'Repository name')
193
- .requiredOption('-p, --pipeline-name <pipelineName>', 'Pipeline name')
194
- .requiredOption('-b, --branch <branch>', 'Branch name')
195
- .option(
196
- '-v, --variables <key=value>',
197
- 'Pipeline variable as key=value pair',
198
- (value, previous) => {
199
- const [key, val] = value.split('=');
200
- if (!key || val === undefined) {
201
- throw new Error(`Invalid variable format: ${value}. Use key=value.`);
202
- }
203
- return { ...previous, [key]: val };
204
- },
205
- {},
206
- )
207
- .option('-w, --wait', 'Wait for the pipeline to complete', false) // Defaults to false
208
- .action(async (cmdObj) => {
209
- try {
210
- const { repository, pipelineName, branch, variables, wait } = cmdObj;
211
-
212
- // Call the triggerPipelineByName function
213
- await runPipeline(repository, pipelineName, branch, variables, wait);
214
- } catch (error) {
215
- console.error('Error triggering pipeline:', error.message);
216
- process.exit(1);
217
- }
218
- });
219
-
220
- program.parse(process.argv);
1
+ #!/usr/bin/env node
2
+
3
+ import { Command } from 'commander';
4
+ import { pull } from './pull.js';
5
+ import { sonar } from './sonar.js';
6
+ import { publish } from './publish.js';
7
+ import {
8
+ deployAppWithTag,
9
+ deployFromSite,
10
+ deployTemplate,
11
+ getDefaultDeploySite,
12
+ getDeployTag,
13
+ } from './deploy.js';
14
+ import { copy, copy2 } from './copy.js';
15
+ import { vaultAddSiteData } from './vault.js';
16
+ import { addApacheSite } from './apache.js';
17
+ import { haproxySync } from './haproxy.js';
18
+ import { connectClone } from './connect.js';
19
+ import dotenv from 'dotenv';
20
+ import { $ } from 'zx';
21
+ import { deployConnect, deployCore } from './jenkins.js';
22
+ import { runPipeline } from './pipline.js';
23
+
24
+ dotenv.config({ path: ['.env.pipeline.local', 'config/.env.pipeline.local'] });
25
+
26
+ const program = new Command();
27
+
28
+ const GIT_SHA = (await $`git log --pretty=format:'%h' -n 1`).stdout.trim();
29
+
30
+ program
31
+ .command('pull <imageName>')
32
+ .description('Pull a Docker image from the registry')
33
+ .action(async (imageName) => {
34
+ await pull(imageName);
35
+ });
36
+
37
+ program
38
+ .command('sonar')
39
+ .description('Run Sonar analysis')
40
+ .action(async () => {
41
+ await sonar(GIT_SHA);
42
+ });
43
+
44
+ program
45
+ .command('addApacheSite')
46
+ .description('Add site to apache')
47
+ .action(async () => {
48
+ await addApacheSite();
49
+ });
50
+
51
+ program
52
+ .command('connectClone')
53
+ .description('Clone connect site')
54
+ .action(async () => {
55
+ await connectClone();
56
+ });
57
+
58
+ program
59
+ .command('haproxySync')
60
+ .description('Sync haproxy config')
61
+ .action(async () => {
62
+ await haproxySync();
63
+ });
64
+
65
+ program
66
+ .command('vaultAddSiteData')
67
+ .description('Add m2m auth0 data to vault')
68
+ .requiredOption('-s, --site-name <siteName>', 'Site name')
69
+ .requiredOption(
70
+ '-p, --site-config-remote-path <siteConfigRemotePath>',
71
+ 'Site Config Remote Path',
72
+ )
73
+ .action(async (options) => {
74
+ const { siteName, siteConfigRemotePath } = options;
75
+ await vaultAddSiteData(siteName, siteConfigRemotePath);
76
+ });
77
+
78
+ program
79
+ .command('publish')
80
+ .description('Publish a Docker image')
81
+ .action(async () => {
82
+ await publish(GIT_SHA);
83
+ });
84
+
85
+ program
86
+ .command('deploy-from-site')
87
+ .description('Deploy an application for a specific site')
88
+ .requiredOption('-f, --from-env <fromEnv>', 'Source environment')
89
+ .requiredOption('-t, --to-env <toEnv>', 'Target environment')
90
+ .requiredOption('-F, --from-site <fromSite>', 'Source site')
91
+ .requiredOption('-T, --to-site <toSite>', 'Target site')
92
+ .option('-c, --deploy-core <deployCore>', 'Deploy Core', 'false')
93
+ .option('-C, --deploy-connect <deployConnect>', 'Deploy Connect', 'false')
94
+ .action(async (options) => {
95
+ const { fromEnv, fromSite, toEnv, toSite, deployCore, deployConnect } =
96
+ options;
97
+ await deployFromSite(
98
+ fromEnv,
99
+ fromSite,
100
+ toEnv,
101
+ toSite,
102
+ deployCore,
103
+ deployConnect,
104
+ );
105
+ });
106
+
107
+ program
108
+ .command('deploy-template [tagPrefix]')
109
+ .description('Deploy an application for a specific site')
110
+ .action(async (tagPrefix) => {
111
+ const deployTag = await getDeployTag(tagPrefix);
112
+ const { env, site } = await getDefaultDeploySite(deployTag);
113
+ await deployTemplate(env, site, deployTag);
114
+ });
115
+
116
+ program
117
+ .command('deployTemplate')
118
+ .description('Deploy an application for a specific site')
119
+ .action(async () => {
120
+ const deployTag = await getDeployTag();
121
+ const { env, site } = await getDefaultDeploySite(deployTag);
122
+ await deployTemplate(env, site, deployTag);
123
+ });
124
+
125
+ program
126
+ .command('deploy-app <application>')
127
+ .description('Deploy an application for a specific site')
128
+ .action(async (application) => {
129
+ const deployTag = await getDeployTag();
130
+ const { env, site } = await getDefaultDeploySite(deployTag);
131
+ await deployAppWithTag(application, env, site, deployTag);
132
+ });
133
+
134
+ program
135
+ .command('deploy-mono-app <tag> <application>')
136
+ .description('Deploy an application for a specific site')
137
+ .action(async (tag, application) => {
138
+ const deployTag = await getDeployTag(tag);
139
+ const version = 'v' + deployTag.split('@')[1];
140
+ const { env, site } = await getDefaultDeploySite(version);
141
+ await deployAppWithTag(application, env, site, version);
142
+ });
143
+
144
+ program
145
+ .command('deploy-core <env> <site>')
146
+ .description('Deploy Core')
147
+ .option('-l, --liquibase <liquibase>', 'Application name', 'true')
148
+ .option('-b, --branch <branch>', 'Branch', 'master')
149
+ .action(async (env, site, options) => {
150
+ await deployCore(env, site, options.liquibase, options.branch);
151
+ });
152
+
153
+ program
154
+ .command('deploy-connect <env> <site>')
155
+ .description('Deploy Core')
156
+ .option('-l, --liquibase <liquibase>', 'Application name', 'true')
157
+ .option('-b, --branch <branch>', 'Branch', 'master')
158
+ .action(async (env, site, options) => {
159
+ await deployConnect(env, site, options.liquibase, options.branch);
160
+ });
161
+
162
+ program
163
+ .command('deploy-core-pipeline <env> <site>')
164
+ .description('Deploy Core')
165
+ .option('-l, --liquibase <liquibase>', 'Application name', 'true')
166
+ .option('-b, --branch <branch>', 'Branch', 'master')
167
+ .action(async (env, site, options) => {
168
+ await runPipeline('site-deploy', 'deploy-core', 'main', {
169
+ ENV: env,
170
+ SITE: site,
171
+ LIQUIBASE: options.liquibase,
172
+ BRANCH: options.branch,
173
+ });
174
+ });
175
+
176
+ program
177
+ .command('copy')
178
+ .description('Copy a Docker image between registries')
179
+ .requiredOption('-r, --repository <repository>', 'Repostory name')
180
+ .requiredOption('-f, --from-env <fromEnv>', 'Source environment')
181
+ .requiredOption('-t, --to-env <toEnv>', 'Target environment')
182
+ .requiredOption('-g, --tag <tag>', 'Image tag')
183
+ .requiredOption('-a, --application <application>', 'Application name')
184
+ .action(async (options) => {
185
+ const { repository, fromEnv, toEnv, tag, application } = options;
186
+ await copy2(repository, fromEnv, toEnv, tag, application);
187
+ });
188
+
189
+ program
190
+ .command('run-pipeline')
191
+ .description('Trigger a pipeline by name')
192
+ .requiredOption('-r, --repository <repository>', 'Repository name')
193
+ .requiredOption('-p, --pipeline-name <pipelineName>', 'Pipeline name')
194
+ .requiredOption('-b, --branch <branch>', 'Branch name')
195
+ .option(
196
+ '-v, --variables <key=value>',
197
+ 'Pipeline variable as key=value pair',
198
+ (value, previous) => {
199
+ const [key, val] = value.split('=');
200
+ if (!key || val === undefined) {
201
+ throw new Error(`Invalid variable format: ${value}. Use key=value.`);
202
+ }
203
+ return { ...previous, [key]: val };
204
+ },
205
+ {},
206
+ )
207
+ .option('-w, --wait', 'Wait for the pipeline to complete', false) // Defaults to false
208
+ .action(async (cmdObj) => {
209
+ try {
210
+ const { repository, pipelineName, branch, variables, wait } = cmdObj;
211
+
212
+ // Call the triggerPipelineByName function
213
+ await runPipeline(repository, pipelineName, branch, variables, wait);
214
+ } catch (error) {
215
+ console.error('Error triggering pipeline:', error.message);
216
+ process.exit(1);
217
+ }
218
+ });
219
+
220
+ program.parse(process.argv);