@docupace/pipeline 1.0.137 → 1.1.1
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/CHANGELOG.md +34 -0
- package/README.md +15 -0
- package/package.json +12 -11
- package/pnpm-workspace.yaml +4 -0
- package/src/auth0/cli.js +0 -0
- package/src/changeset/cli.js +0 -0
- package/src/merge/cli.js +0 -0
- package/src/micro/cli.js +0 -0
- package/src/next/cli.js +66 -4
- package/src/next/connect-aws-cli.js +206 -0
- package/src/next/connect-aws.js +1858 -0
- package/src/next/connect-aws.test.js +131 -0
- package/src/next/deploy.js +95 -2
- package/src/next/deploy.test.js +1 -0
- package/src/tenable/cli.js +0 -0
- package/src/veracode/cli.js +0 -0
- package/src/xray/cli.js +0 -0
- package/.gitignore +0 -109
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# @docupace/pipeline
|
|
2
2
|
|
|
3
|
+
## 1.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- acec071: DC-106888 Publish the CONNECT AWS onboarding release under a new version. The 1.1.0 release commit could not be tagged because v1.1.0 already existed on an older commit, so this patch release tags the onboarding code as v1.1.1 with no code changes.
|
|
8
|
+
|
|
9
|
+
## 1.1.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 126e3d3: DC-106887 Create or populate the dedicated CONNECT runtime secret with its existing secret.conf field, validate required values, reuse complete credentials, and resolve SSO settings and database credentials from target environment sources. Keep the shared site secret and Helm charts unchanged.
|
|
14
|
+
|
|
15
|
+
DC-106888 Add idempotent CONNECT/CORE/NEXT fleet registration for prepared site values, preserving existing chart revisions and unrelated applications. Validate that CONNECT onboarding branches contain only the intended fleet addition before automatic merge.
|
|
16
|
+
|
|
17
|
+
Normalize preprod to qa and staging/stg to stage across onboarding commands, retaining preprod-site-settings and staging-site-settings repository names. Preserve matching explicit namespaces in existing fleet entries.
|
|
18
|
+
|
|
19
|
+
Require successful downstream configuration sync completion when requested by onboarding, with bounded polling and failure reporting after Git publication.
|
|
20
|
+
|
|
21
|
+
- 213dbc2: DC-106885 Add copy-connect-site for the existing site-setup pipeline, supporting the default template or an existing site, cross-environment copies with target backend settings, target Core identity and Auth0 SAML metadata. Keep CONNECT AWS SAML generation in connect-aws.js and route the metadata CLI to it without changing the working directory; leave the legacy metadata module unchanged.
|
|
22
|
+
|
|
23
|
+
Resolve target Core identity and database configuration from the target environment's site-settings checkout, retaining explicit overrides for exceptional configurations.
|
|
24
|
+
|
|
25
|
+
Add explicit force-overwrite support to regenerate an existing target, preparing replacement files before swapping directories and restoring the previous files if installation fails.
|
|
26
|
+
|
|
27
|
+
Add read-only Pod Identity/runtime-secret readiness and published-image checks for conditional GitOps merges. Restore the legacy Connect auto-login and Next UI launch settings when copying a site.
|
|
28
|
+
|
|
29
|
+
Preserve the selected source image repository and exact tag. An explicit image-tag override changes only the tag; image validation does not substitute a shared repository or a v-prefixed tag.
|
|
30
|
+
|
|
31
|
+
## 1.1.0
|
|
32
|
+
|
|
33
|
+
### Minor Changes
|
|
34
|
+
|
|
35
|
+
- 1fb7d37: Add support for Connect deploy
|
|
36
|
+
|
|
3
37
|
## 1.0.136
|
|
4
38
|
|
|
5
39
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -51,20 +51,28 @@ dp-next-cli [command] [options]
|
|
|
51
51
|
- `-j, --jira-ticket [jiraTicket]`: JIRA ticket (optional)
|
|
52
52
|
- `-c, --deploy-core <deployCore>`: Deploy Core (default: "false")
|
|
53
53
|
- `-C, --deploy-connect <deployConnect>`: Deploy Connect (default: "false")
|
|
54
|
+
- `-A, --deploy-connect-aws <deployConnectAws>`: Deploy Connect UI on AWS via `dp-eks-connect-ui-gitops` (default: "false")
|
|
54
55
|
- `update-site-version <env> <site>`: Update specific version components for a site
|
|
55
56
|
- `-u, --ui-version <uiVersion>`: UI image tag
|
|
56
57
|
- `-g, --graph-version <graphVersion>`: GraphQL-server image tag
|
|
57
58
|
- `-S, --standard-config <standardConfig>`: Standard config remote branch
|
|
58
59
|
- `-s, --site-config <siteConfig>`: Site config remote branch
|
|
60
|
+
- `-c, --connect-version <connectVersion>`: AWS Connect UI image tag (optional)
|
|
59
61
|
- `-j, --jira-ticket [jiraTicket]`: JIRA ticket (required for prod)
|
|
60
62
|
- `deploy-template`: Deploy an application for a specific site
|
|
61
63
|
- `deploy-app <application>`: Deploy an application for a specific site
|
|
64
|
+
- `deploy-app connect -e <env> -s <site>`: Deploy AWS Connect UI (triggers `deploy-connect-aws` / gitops `update-site-image`)
|
|
65
|
+
- `-e, --env <env>` / `-s, --site <site>`: Target env/site (optional; otherwise uses auto-deploy targets)
|
|
62
66
|
- `deploy-core <env> <site>`: Deploy Core
|
|
63
67
|
- `-l, --liquibase <liquibase>`: Application name (default: "true")
|
|
64
68
|
- `-b, --branch <branch>`: Branch (default: "master")
|
|
65
69
|
- `deploy-connect <env> <site>`: Deploy Connect
|
|
66
70
|
- `-l, --liquibase <liquibase>`: Application name (default: "true")
|
|
67
71
|
- `-b, --branch <branch>`: Branch (default: "master")
|
|
72
|
+
- `deploy-connect-aws <env> <sites> <version>`: Deploy Connect UI on AWS (updates `dp-eks-connect-ui-gitops` image.tag via Bitbucket pipeline)
|
|
73
|
+
- `<sites>`: single site or comma-separated list (e.g. `oa` or `oa,athene,template`)
|
|
74
|
+
- `-b, --branch <branch>`: Gitops branch for the pipeline (default: "main")
|
|
75
|
+
- `-w, --wait` / `--no-wait`: Wait for pipeline completion (default: wait)
|
|
68
76
|
- `deploy-core-pipeline <env> <site>`: Deploy Core via pipeline
|
|
69
77
|
- `-l, --liquibase <liquibase>`: Application name (default: "true")
|
|
70
78
|
- `-b, --branch <branch>`: Branch (default: "master")
|
|
@@ -187,6 +195,13 @@ dp-changeset-cli create-changeset
|
|
|
187
195
|
|
|
188
196
|
# Configure Auth0 for a site
|
|
189
197
|
dp-auth0-cli configureFromSite sourceSite targetSite dev prod true true true false
|
|
198
|
+
|
|
199
|
+
# Deploy Connect UI image tag on AWS (single site or comma-separated sites)
|
|
200
|
+
dp-next-cli deploy-connect-aws qa 1stglobal 4.75.52
|
|
201
|
+
dp-next-cli deploy-connect-aws qa oa,athene,template 4.75.52
|
|
202
|
+
|
|
203
|
+
# Promote AWS Connect UI version from one site to another via deploy-from-site
|
|
204
|
+
dp-next-cli deploy-from-site -f dev -t qa -F template -T template -A true
|
|
190
205
|
```
|
|
191
206
|
|
|
192
207
|
## License
|
package/package.json
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docupace/pipeline",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"prepublishOnly": "pnpm test",
|
|
9
|
+
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --coverage --testPathIgnorePatterns='src/next/test\\.js'",
|
|
10
|
+
"test-deploy-core": "dp-next-cli deploy-core-pipeline dev template",
|
|
11
|
+
"test-deploy-from-site": "dp-next-cli deploy-from-site --from-env dev --to-env dev --from-site financialdev --to-site template --deploy-core true",
|
|
12
|
+
"test-run-pipline": "dp-next-cli run-pipeline -r docupace-next-e2e -b master -p run-tests-qa",
|
|
13
|
+
"test-validate": "dp-changset-cli validate",
|
|
14
|
+
"test-create": "dp-changset-cli create-changeset",
|
|
15
|
+
"lint:fix": "eslint --fix \"src/**/*.{js,jsx,ts,tsx}\""
|
|
16
|
+
},
|
|
7
17
|
"exports": {
|
|
8
18
|
"./changelogCanny": "./src/changeset/changelog-module.cjs"
|
|
9
19
|
},
|
|
@@ -53,14 +63,5 @@
|
|
|
53
63
|
"globals": "^15.14.0",
|
|
54
64
|
"jest": "^30.4.2",
|
|
55
65
|
"prettier": "^3.4.2"
|
|
56
|
-
},
|
|
57
|
-
"scripts": {
|
|
58
|
-
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --coverage --testPathIgnorePatterns='src/next/test\\.js'",
|
|
59
|
-
"test-deploy-core": "dp-next-cli deploy-core-pipeline dev template",
|
|
60
|
-
"test-deploy-from-site": "dp-next-cli deploy-from-site --from-env dev --to-env dev --from-site financialdev --to-site template --deploy-core true",
|
|
61
|
-
"test-run-pipline": "dp-next-cli run-pipeline -r docupace-next-e2e -b master -p run-tests-qa",
|
|
62
|
-
"test-validate": "dp-changset-cli validate",
|
|
63
|
-
"test-create": "dp-changset-cli create-changeset",
|
|
64
|
-
"lint:fix": "eslint --fix \"src/**/*.{js,jsx,ts,tsx}\""
|
|
65
66
|
}
|
|
66
|
-
}
|
|
67
|
+
}
|
package/pnpm-workspace.yaml
CHANGED
package/src/auth0/cli.js
CHANGED
|
File without changes
|
package/src/changeset/cli.js
CHANGED
|
File without changes
|
package/src/merge/cli.js
CHANGED
|
File without changes
|
package/src/micro/cli.js
CHANGED
|
File without changes
|
package/src/next/cli.js
CHANGED
|
@@ -20,6 +20,8 @@ import { connectClone } from './connect.js';
|
|
|
20
20
|
import dotenv from 'dotenv';
|
|
21
21
|
import { $ } from 'zx';
|
|
22
22
|
import { deployConnect, deployCore } from './jenkins.js';
|
|
23
|
+
import { deployConnectAws, runPipelineChecked } from './connect-aws.js';
|
|
24
|
+
import { registerConnectAwsCommands } from './connect-aws-cli.js';
|
|
23
25
|
import { runPipeline } from './pipline.js';
|
|
24
26
|
|
|
25
27
|
dotenv.config({ path: ['.env.pipeline.local', 'config/.env.pipeline.local'] });
|
|
@@ -56,6 +58,8 @@ program
|
|
|
56
58
|
await connectClone();
|
|
57
59
|
});
|
|
58
60
|
|
|
61
|
+
registerConnectAwsCommands(program);
|
|
62
|
+
|
|
59
63
|
program
|
|
60
64
|
.command('haproxySync')
|
|
61
65
|
.description('Sync haproxy config')
|
|
@@ -93,6 +97,11 @@ program
|
|
|
93
97
|
.option('-j, --jira-ticket [jiraTicket]', 'JIRA ticket (optional)')
|
|
94
98
|
.option('-c, --deploy-core <deployCore>', 'Deploy Core', 'false')
|
|
95
99
|
.option('-C, --deploy-connect <deployConnect>', 'Deploy Connect', 'false')
|
|
100
|
+
.option(
|
|
101
|
+
'-A, --deploy-connect-aws <deployConnectAws>',
|
|
102
|
+
'Deploy Connect UI on AWS (dp-eks-connect-ui-gitops)',
|
|
103
|
+
'false',
|
|
104
|
+
)
|
|
96
105
|
.action(async (options) => {
|
|
97
106
|
const {
|
|
98
107
|
fromEnv,
|
|
@@ -101,6 +110,7 @@ program
|
|
|
101
110
|
toSite,
|
|
102
111
|
deployCore,
|
|
103
112
|
deployConnect,
|
|
113
|
+
deployConnectAws: deployConnectAwsFlag,
|
|
104
114
|
jiraTicket,
|
|
105
115
|
} = options;
|
|
106
116
|
await deployFromSite(
|
|
@@ -111,6 +121,7 @@ program
|
|
|
111
121
|
deployCore,
|
|
112
122
|
deployConnect,
|
|
113
123
|
jiraTicket,
|
|
124
|
+
deployConnectAwsFlag,
|
|
114
125
|
);
|
|
115
126
|
});
|
|
116
127
|
|
|
@@ -124,10 +135,20 @@ program
|
|
|
124
135
|
'Standard config remote branch',
|
|
125
136
|
)
|
|
126
137
|
.option('-s, --site-config <siteConfig>', 'Site config remote branch')
|
|
138
|
+
.option(
|
|
139
|
+
'-c, --connect-version <connectVersion>',
|
|
140
|
+
'AWS Connect UI image tag (triggers deploy-connect-aws)',
|
|
141
|
+
)
|
|
127
142
|
.option('-j, --jira-ticket [jiraTicket]', 'JIRA ticket (required for prod)')
|
|
128
143
|
.action(async (env, site, options) => {
|
|
129
|
-
const {
|
|
130
|
-
|
|
144
|
+
const {
|
|
145
|
+
uiVersion,
|
|
146
|
+
graphVersion,
|
|
147
|
+
standardConfig,
|
|
148
|
+
siteConfig,
|
|
149
|
+
connectVersion,
|
|
150
|
+
jiraTicket,
|
|
151
|
+
} = options;
|
|
131
152
|
await updateSiteVersion(
|
|
132
153
|
env,
|
|
133
154
|
site,
|
|
@@ -136,6 +157,7 @@ program
|
|
|
136
157
|
standardConfig,
|
|
137
158
|
siteConfig,
|
|
138
159
|
jiraTicket,
|
|
160
|
+
connectVersion,
|
|
139
161
|
);
|
|
140
162
|
});
|
|
141
163
|
|
|
@@ -174,7 +196,9 @@ program
|
|
|
174
196
|
|
|
175
197
|
program
|
|
176
198
|
.command('deploy-app <application>')
|
|
177
|
-
.description(
|
|
199
|
+
.description(
|
|
200
|
+
'Deploy an application for a specific site (use application "connect" for AWS Connect UI)',
|
|
201
|
+
)
|
|
178
202
|
.option('-e, --env <env>', 'Target environment (overrides default sites)')
|
|
179
203
|
.option('-s, --site <site>', 'Target site (overrides default sites)')
|
|
180
204
|
.action(async (application, options) => {
|
|
@@ -183,6 +207,19 @@ program
|
|
|
183
207
|
options.env && options.site
|
|
184
208
|
? [{ env: options.env, site: options.site }]
|
|
185
209
|
: await getDefaultDeploySite(deployTag);
|
|
210
|
+
|
|
211
|
+
// Batch Connect AWS updates into one pipeline run per env (comma-separated sites).
|
|
212
|
+
if (application === 'connect') {
|
|
213
|
+
const sitesByEnv = sites.reduce((acc, { env, site }) => {
|
|
214
|
+
(acc[env] ??= []).push(site);
|
|
215
|
+
return acc;
|
|
216
|
+
}, {});
|
|
217
|
+
for (const [env, envSites] of Object.entries(sitesByEnv)) {
|
|
218
|
+
await deployAppWithTag('connect', env, envSites.join(','), deployTag);
|
|
219
|
+
}
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
|
|
186
223
|
for (const { env, site } of sites) {
|
|
187
224
|
await deployAppWithTag(application, env, site, deployTag);
|
|
188
225
|
}
|
|
@@ -223,6 +260,21 @@ program
|
|
|
223
260
|
await deployConnect(env, site, options.liquibase, options.branch);
|
|
224
261
|
});
|
|
225
262
|
|
|
263
|
+
program
|
|
264
|
+
.command('deploy-connect-aws <env> <sites> <version>')
|
|
265
|
+
.description(
|
|
266
|
+
'Deploy Connect UI on AWS by updating image.tag via dp-eks-connect-ui-gitops pipeline',
|
|
267
|
+
)
|
|
268
|
+
.option('-b, --branch <branch>', 'Gitops branch to run pipeline on', 'main')
|
|
269
|
+
.option('-w, --wait', 'Wait for the pipeline to complete', true)
|
|
270
|
+
.option('--no-wait', 'Do not wait for the pipeline to complete')
|
|
271
|
+
.action(async (env, sites, version, options) => {
|
|
272
|
+
await deployConnectAws(env, sites, version, {
|
|
273
|
+
wait: options.wait,
|
|
274
|
+
branch: options.branch,
|
|
275
|
+
});
|
|
276
|
+
});
|
|
277
|
+
|
|
226
278
|
program
|
|
227
279
|
.command('deploy-core-pipeline <env> <site>')
|
|
228
280
|
.description('Deploy Core')
|
|
@@ -269,12 +321,22 @@ program
|
|
|
269
321
|
{},
|
|
270
322
|
)
|
|
271
323
|
.option('-w, --wait', 'Wait for the pipeline to complete', false) // Defaults to false
|
|
324
|
+
.option(
|
|
325
|
+
'--require-success',
|
|
326
|
+
'Fail unless the downstream pipeline succeeds',
|
|
327
|
+
false,
|
|
328
|
+
)
|
|
272
329
|
.action(async (cmdObj) => {
|
|
273
330
|
try {
|
|
274
331
|
const { repository, pipelineName, branch, variables, wait } = cmdObj;
|
|
275
332
|
|
|
276
333
|
// Call the triggerPipelineByName function
|
|
277
|
-
|
|
334
|
+
if (cmdObj.requireSuccess) {
|
|
335
|
+
if (!wait) throw new Error('--require-success requires --wait.');
|
|
336
|
+
await runPipelineChecked(repository, pipelineName, branch, variables);
|
|
337
|
+
} else {
|
|
338
|
+
await runPipeline(repository, pipelineName, branch, variables, wait);
|
|
339
|
+
}
|
|
278
340
|
} catch (error) {
|
|
279
341
|
console.error('Error triggering pipeline:', error.message);
|
|
280
342
|
process.exit(1);
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { writeFile } from 'node:fs/promises';
|
|
2
|
+
import {
|
|
3
|
+
copyConnectSite,
|
|
4
|
+
ensureConnectRuntimeSecret,
|
|
5
|
+
registerSiteApps,
|
|
6
|
+
getFleetValuesSource,
|
|
7
|
+
validateConnectFleetChange,
|
|
8
|
+
syncConnectConfig,
|
|
9
|
+
} from './connect-aws.js';
|
|
10
|
+
|
|
11
|
+
export function registerConnectAwsCommands(program) {
|
|
12
|
+
program
|
|
13
|
+
.command('prepare-connect-secret')
|
|
14
|
+
.description('Create or populate the dedicated CONNECT runtime secret')
|
|
15
|
+
.requiredOption('--env <env>', 'Target environment')
|
|
16
|
+
.requiredOption('--site <site>', 'Target site')
|
|
17
|
+
.requiredOption(
|
|
18
|
+
'--site-settings-path <path>',
|
|
19
|
+
'Target Core site-settings checkout',
|
|
20
|
+
)
|
|
21
|
+
.option('--core-schema <schema>', 'Override target Core settings directory')
|
|
22
|
+
.option(
|
|
23
|
+
'--db-source-secret <name>',
|
|
24
|
+
'Target-account DB credential source; defaults to target CONNECT template',
|
|
25
|
+
)
|
|
26
|
+
.option(
|
|
27
|
+
'--db-user-property <name>',
|
|
28
|
+
'DB username property',
|
|
29
|
+
'CONNECT_DB_USER',
|
|
30
|
+
)
|
|
31
|
+
.option(
|
|
32
|
+
'--db-password-property <name>',
|
|
33
|
+
'DB password property',
|
|
34
|
+
'CONNECT_DB_PASSWORD',
|
|
35
|
+
)
|
|
36
|
+
.option('--dry-run', 'Validate and report without writing AWS', false)
|
|
37
|
+
.option(
|
|
38
|
+
'--result-file <path>',
|
|
39
|
+
'Write secret reference only, without credential values',
|
|
40
|
+
)
|
|
41
|
+
.action(async ({ resultFile, ...options }) => {
|
|
42
|
+
try {
|
|
43
|
+
const result = await ensureConnectRuntimeSecret(options);
|
|
44
|
+
if (resultFile)
|
|
45
|
+
await writeFile(resultFile, JSON.stringify(result, null, 2));
|
|
46
|
+
console.log(
|
|
47
|
+
`CONNECT runtime secret ${result.status}: ${result.secretName}`,
|
|
48
|
+
);
|
|
49
|
+
} catch (error) {
|
|
50
|
+
console.error(error.message);
|
|
51
|
+
process.exitCode = 1;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
program
|
|
56
|
+
.command('validate-connect-fleet-change')
|
|
57
|
+
.description(
|
|
58
|
+
'Reject existing or unrelated fleet edits before an automatic CONNECT merge',
|
|
59
|
+
)
|
|
60
|
+
.requiredOption('--env <env>', 'Target environment')
|
|
61
|
+
.requiredOption('--site <site>', 'Target site')
|
|
62
|
+
.requiredOption('--before-file <path>', 'Fleet at the branch merge base')
|
|
63
|
+
.requiredOption('--after-file <path>', 'Prepared fleet')
|
|
64
|
+
.action(async (options) => {
|
|
65
|
+
try {
|
|
66
|
+
await validateConnectFleetChange(options);
|
|
67
|
+
console.log(
|
|
68
|
+
'CONNECT fleet changes are limited to the target registration.',
|
|
69
|
+
);
|
|
70
|
+
} catch (error) {
|
|
71
|
+
console.error(error.message);
|
|
72
|
+
process.exitCode = 1;
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
program
|
|
77
|
+
.command('register-site-apps')
|
|
78
|
+
.description(
|
|
79
|
+
'Register prepared CONNECT, CORE and NEXT site values in the target fleets',
|
|
80
|
+
)
|
|
81
|
+
.requiredOption('--env <env>', 'Target environment')
|
|
82
|
+
.requiredOption('--site <site>', 'Target site')
|
|
83
|
+
.option('--apps <apps>', 'Comma-separated CONNECT,CORE,NEXT', 'CONNECT')
|
|
84
|
+
.option('--connect-repo-path <path>', 'CONNECT GitOps checkout')
|
|
85
|
+
.option('--next-repo-path <path>', 'NEXT/Core chart and fleet checkout')
|
|
86
|
+
.option('--config-repo-path <path>', 'Target gitops-env values checkout')
|
|
87
|
+
.option(
|
|
88
|
+
'--config-revision <revision>',
|
|
89
|
+
'Revision of the target values checkout',
|
|
90
|
+
)
|
|
91
|
+
.option(
|
|
92
|
+
'--chart-revision <revision>',
|
|
93
|
+
'Chart revision for new CORE/NEXT applications',
|
|
94
|
+
'develop',
|
|
95
|
+
)
|
|
96
|
+
.option('--dry-run', 'Validate and report without writing files', false)
|
|
97
|
+
.option(
|
|
98
|
+
'--resolve-config-source',
|
|
99
|
+
'Report the configured CORE/NEXT values source only',
|
|
100
|
+
false,
|
|
101
|
+
)
|
|
102
|
+
.option('--result-file <path>', 'Write planned/updated fleet paths')
|
|
103
|
+
.action(async ({ resultFile, ...options }) => {
|
|
104
|
+
try {
|
|
105
|
+
const result = options.resolveConfigSource
|
|
106
|
+
? await getFleetValuesSource(options)
|
|
107
|
+
: await registerSiteApps(options);
|
|
108
|
+
if (resultFile)
|
|
109
|
+
await writeFile(resultFile, JSON.stringify(result, null, 2));
|
|
110
|
+
console.log(JSON.stringify(result));
|
|
111
|
+
} catch (error) {
|
|
112
|
+
console.error(error.message);
|
|
113
|
+
process.exitCode = 1;
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
program
|
|
118
|
+
.command('copy-connect-site')
|
|
119
|
+
.description(
|
|
120
|
+
'Copy a CONNECT GitOps template and generate target Auth0 SAML configuration',
|
|
121
|
+
)
|
|
122
|
+
.requiredOption('-e, --env <env>', 'Target environment')
|
|
123
|
+
.requiredOption('-s, --site <site>', 'New target site')
|
|
124
|
+
.option(
|
|
125
|
+
'--force-overwrite',
|
|
126
|
+
'Replace an existing target site with regenerated source configuration',
|
|
127
|
+
false,
|
|
128
|
+
)
|
|
129
|
+
.option(
|
|
130
|
+
'--site-settings-path <path>',
|
|
131
|
+
'Target Core site-settings checkout for automatic configuration',
|
|
132
|
+
)
|
|
133
|
+
.option('--core-schema <schema>', 'Override target Core database schema')
|
|
134
|
+
.option('--core-realm <realm>', 'Override target Core private realm')
|
|
135
|
+
.option(
|
|
136
|
+
'--runtime-secret-name <name>',
|
|
137
|
+
'Prepared target AWS runtime secret',
|
|
138
|
+
)
|
|
139
|
+
.option(
|
|
140
|
+
'--template-site <site>',
|
|
141
|
+
'Source template or existing site',
|
|
142
|
+
'template',
|
|
143
|
+
)
|
|
144
|
+
.option(
|
|
145
|
+
'--template-env <env>',
|
|
146
|
+
'Source environment (defaults to target environment)',
|
|
147
|
+
)
|
|
148
|
+
.option(
|
|
149
|
+
'--db-url <url>',
|
|
150
|
+
'Target JDBC URL; required for cross-environment copies',
|
|
151
|
+
)
|
|
152
|
+
.option(
|
|
153
|
+
'--core-api-url <url>',
|
|
154
|
+
'Target Core backend URL; required for cross-environment copies',
|
|
155
|
+
)
|
|
156
|
+
.option(
|
|
157
|
+
'--result-file <path>',
|
|
158
|
+
'Write generated site identity as JSON for pipeline orchestration',
|
|
159
|
+
)
|
|
160
|
+
.option(
|
|
161
|
+
'--repo-path <path>',
|
|
162
|
+
'Existing CONNECT GitOps checkout',
|
|
163
|
+
process.cwd(),
|
|
164
|
+
)
|
|
165
|
+
.option('--base-url <url>', 'Public CONNECT HTTPS origin')
|
|
166
|
+
.option(
|
|
167
|
+
'--core-url <url>',
|
|
168
|
+
'Public Core URL (defaults to target origin/core)',
|
|
169
|
+
)
|
|
170
|
+
.option(
|
|
171
|
+
'--image-tag <tag>',
|
|
172
|
+
'Override the inherited image tag; keep the source image repository',
|
|
173
|
+
)
|
|
174
|
+
.option('--context-path <path>', 'CONNECT context path', '/connect')
|
|
175
|
+
.option(
|
|
176
|
+
'--auth0-tenant <tenant>',
|
|
177
|
+
'Target Auth0 tenant name or auth0.com domain',
|
|
178
|
+
'',
|
|
179
|
+
)
|
|
180
|
+
.action(async (options) => {
|
|
181
|
+
try {
|
|
182
|
+
const { resultFile, ...copyOptions } = options;
|
|
183
|
+
const result = await copyConnectSite(copyOptions);
|
|
184
|
+
if (resultFile)
|
|
185
|
+
await writeFile(resultFile, JSON.stringify(result, null, 2));
|
|
186
|
+
} catch (error) {
|
|
187
|
+
console.error(`CONNECT site copy failed: ${error.message}`);
|
|
188
|
+
process.exitCode = 1;
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
program
|
|
193
|
+
.command('sync-connect-config')
|
|
194
|
+
.description(
|
|
195
|
+
'Run the target CONNECT GitOps configuration sync and require success',
|
|
196
|
+
)
|
|
197
|
+
.requiredOption('-e, --env <env>', 'Target CONNECT environment')
|
|
198
|
+
.action(async (options) => {
|
|
199
|
+
try {
|
|
200
|
+
await syncConnectConfig(options);
|
|
201
|
+
} catch (error) {
|
|
202
|
+
console.error(error.message);
|
|
203
|
+
process.exitCode = 1;
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
}
|