@docupace/pipeline 1.0.57 → 1.0.58
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/auth0/cli.js +5 -3
- package/src/auth0/configure.js +154 -82
package/package.json
CHANGED
package/src/auth0/cli.js
CHANGED
|
@@ -15,7 +15,7 @@ const program = new Command();
|
|
|
15
15
|
|
|
16
16
|
program
|
|
17
17
|
.command(
|
|
18
|
-
'configureFromSite <fromSite> <toSite> <fromEnv> <toEnv> <deployUI> <deployGraphQLServer> <useNewDomain> <
|
|
18
|
+
'configureFromSite <fromSite> <toSite> <fromEnv> <toEnv> <deployUI> <deployGraphQLServer> <useNewDomain> <useS3Ui> <deployCCUI> <useS3Gq> ',
|
|
19
19
|
)
|
|
20
20
|
.description('Configure the Auth0 tenants in env for the given site')
|
|
21
21
|
.action(
|
|
@@ -27,8 +27,9 @@ program
|
|
|
27
27
|
deployUI,
|
|
28
28
|
deployGraphQLServer,
|
|
29
29
|
useNewDomain,
|
|
30
|
-
|
|
30
|
+
useS3Ui,
|
|
31
31
|
deployCCUI,
|
|
32
|
+
useS3Gq,
|
|
32
33
|
) => {
|
|
33
34
|
await configureFromSite(
|
|
34
35
|
fromSite,
|
|
@@ -38,8 +39,9 @@ program
|
|
|
38
39
|
deployUI,
|
|
39
40
|
deployGraphQLServer,
|
|
40
41
|
useNewDomain,
|
|
41
|
-
|
|
42
|
+
useS3Ui === 'true' || useS3Ui === true,
|
|
42
43
|
deployCCUI,
|
|
44
|
+
useS3Gq === 'true' || useS3Gq === true,
|
|
43
45
|
);
|
|
44
46
|
},
|
|
45
47
|
);
|
package/src/auth0/configure.js
CHANGED
|
@@ -10,7 +10,10 @@ import {
|
|
|
10
10
|
readDeployConfig,
|
|
11
11
|
} from '../next/deploy.js';
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
getVaultSecrets,
|
|
15
|
+
updateVaultSecrets
|
|
16
|
+
} from './vault.js';
|
|
14
17
|
import {
|
|
15
18
|
coreSiteEnvMap,
|
|
16
19
|
environmentConfig,
|
|
@@ -19,7 +22,7 @@ import {
|
|
|
19
22
|
|
|
20
23
|
async function ensureDirectoryExists(dirPath) {
|
|
21
24
|
try {
|
|
22
|
-
await fs.promises.mkdir(dirPath, {
|
|
25
|
+
await fs.promises.mkdir(dirPath, {recursive: true});
|
|
23
26
|
console.log(`Directory created or already exists: ${dirPath}`);
|
|
24
27
|
} catch (err) {
|
|
25
28
|
console.error(`Failed to create directory: ${err.message}`);
|
|
@@ -67,6 +70,7 @@ async function configureUI(
|
|
|
67
70
|
auth0Token,
|
|
68
71
|
vaultSiteSecretsPath,
|
|
69
72
|
imageTag,
|
|
73
|
+
revision,
|
|
70
74
|
repoPath,
|
|
71
75
|
useS3,
|
|
72
76
|
) {
|
|
@@ -81,7 +85,7 @@ async function configureUI(
|
|
|
81
85
|
const auth0Response = await axios.get(
|
|
82
86
|
`https://${auth0Domain}/api/v2/clients`,
|
|
83
87
|
{
|
|
84
|
-
headers: {
|
|
88
|
+
headers: {authorization: `Bearer ${auth0Token}`},
|
|
85
89
|
},
|
|
86
90
|
);
|
|
87
91
|
|
|
@@ -117,10 +121,18 @@ async function configureUI(
|
|
|
117
121
|
console.log(`siteAWSSecretsPath => ${siteAWSSecretsPath}`);
|
|
118
122
|
}
|
|
119
123
|
|
|
124
|
+
const awsS3Vars = (useS3 === true || useS3 === 'true')
|
|
125
|
+
? `
|
|
126
|
+
AWS_ACCESS_KEY_ID: vault:secret/data/${site}/aws/config#AWS_ACCESS_KEY_ID
|
|
127
|
+
AWS_BUCKET_NAME: vault:secret/data/${site}/aws/config#AWS_BUCKET_NAME
|
|
128
|
+
AWS_SECRET_ACCESS_KEY: vault:secret/data/${site}/aws/config#AWS_SECRET_ACCESS_KEY
|
|
129
|
+
AWS_REGION: vault:secret/data/${site}/aws/config#AWS_REGION`
|
|
130
|
+
: '';
|
|
131
|
+
|
|
120
132
|
// Prepare ui.app.yaml
|
|
121
133
|
const uiAppYaml = `
|
|
122
134
|
repo: docupace-ui-main
|
|
123
|
-
revision:
|
|
135
|
+
revision: ${revision}
|
|
124
136
|
`.trim();
|
|
125
137
|
|
|
126
138
|
// Prepare ui.values.yaml
|
|
@@ -135,29 +147,19 @@ uiMain:
|
|
|
135
147
|
coreUrl: https://${coreURL}
|
|
136
148
|
env:
|
|
137
149
|
AUTH0_CLIENT_SECRET: vault:secret/data/${site}/ui/config#AUTH0_CLIENT_SECRET
|
|
138
|
-
AUTH0_SECRET: vault:secret/data/${site}/ui/config#AUTH0_SECRET
|
|
139
|
-
${
|
|
140
|
-
useS3 === true || useS3 === 'true'
|
|
141
|
-
? `
|
|
142
|
-
AWS_ACCESS_KEY_ID: vault:secret/data/${site}/aws/config#AWS_ACCESS_KEY_ID
|
|
143
|
-
AWS_BUCKET_NAME: vault:secret/data/${site}/aws/config#AWS_BUCKET_NAME
|
|
144
|
-
AWS_SECRET_ACCESS_KEY: vault:secret/data/${site}/aws/config#AWS_SECRET_ACCESS_KEY
|
|
145
|
-
`.trim()
|
|
146
|
-
: ''
|
|
147
|
-
}
|
|
150
|
+
AUTH0_SECRET: vault:secret/data/${site}/ui/config#AUTH0_SECRET${awsS3Vars ? '\n ' + awsS3Vars.trim() : ''}
|
|
148
151
|
image:
|
|
149
152
|
repository: registry.paperout.com/docupace-ui-main-${env}-docker-local/enterprise-ui-app
|
|
150
153
|
tag: ${imageTag}
|
|
151
154
|
${
|
|
152
|
-
|
|
153
|
-
|
|
155
|
+
useS3 === true || useS3 === 'true'
|
|
156
|
+
? `
|
|
154
157
|
serviceAccount:
|
|
155
158
|
create: true
|
|
156
159
|
annotations:
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
: ''
|
|
160
|
-
}
|
|
160
|
+
"helm.sh/hook": pre-install
|
|
161
|
+
"helm.sh/hook-weight": "-10"
|
|
162
|
+
eks.amazonaws.com/role-arn: arn:aws:iam::${siteAWSSecrets.AWS_ACCOUNT_ID}:role/eks-pod-identity-connect-next-${env}-${site}-bucket`.trim() : ''}`.trim();`
|
|
161
163
|
imagePullSecrets:
|
|
162
164
|
- name: jf-artifactory
|
|
163
165
|
ingress:
|
|
@@ -222,7 +224,7 @@ externalConnectService:
|
|
|
222
224
|
if (err) {
|
|
223
225
|
console.error('Failed to write the file:', err);
|
|
224
226
|
} else {
|
|
225
|
-
console.log(
|
|
227
|
+
console.log(`File ${repoPath}/dp/${site}/ui.app.yaml written successfully.`);
|
|
226
228
|
}
|
|
227
229
|
},
|
|
228
230
|
);
|
|
@@ -234,13 +236,11 @@ externalConnectService:
|
|
|
234
236
|
if (err) {
|
|
235
237
|
console.error('Failed to write the file:', err);
|
|
236
238
|
} else {
|
|
237
|
-
console.log(
|
|
239
|
+
console.log(`File ${repoPath}/dp/${site}/ui.values.yaml written successfully.`);
|
|
238
240
|
}
|
|
239
241
|
},
|
|
240
242
|
);
|
|
241
|
-
console.log('
|
|
242
|
-
console.log('Updating Core Site Config...');
|
|
243
|
-
await updateCoreSiteConfig(site, env, useS3);
|
|
243
|
+
console.log('The UI part is done!');
|
|
244
244
|
} catch (error) {
|
|
245
245
|
console.error('Error configuring UI:', error);
|
|
246
246
|
}
|
|
@@ -259,6 +259,7 @@ async function configureCCUI(
|
|
|
259
259
|
auth0Token,
|
|
260
260
|
vaultSiteSecretsPath,
|
|
261
261
|
imageTag,
|
|
262
|
+
revision,
|
|
262
263
|
repoPath,
|
|
263
264
|
useS3,
|
|
264
265
|
ccUrl,
|
|
@@ -275,7 +276,7 @@ async function configureCCUI(
|
|
|
275
276
|
const auth0Response = await axios.get(
|
|
276
277
|
`https://${auth0Domain}/api/v2/clients`,
|
|
277
278
|
{
|
|
278
|
-
headers: {
|
|
279
|
+
headers: {authorization: `Bearer ${auth0Token}`},
|
|
279
280
|
},
|
|
280
281
|
);
|
|
281
282
|
|
|
@@ -311,13 +312,21 @@ async function configureCCUI(
|
|
|
311
312
|
console.log(`siteAWSSecretsPath => ${siteAWSSecretsPath}`);
|
|
312
313
|
}
|
|
313
314
|
|
|
315
|
+
const awsS3Vars = (useS3 === true || useS3 === 'true')
|
|
316
|
+
? `
|
|
317
|
+
AWS_ACCESS_KEY_ID: vault:secret/data/${site}/aws/config#AWS_ACCESS_KEY_ID
|
|
318
|
+
AWS_BUCKET_NAME: vault:secret/data/${site}/aws/config#AWS_BUCKET_NAME
|
|
319
|
+
AWS_SECRET_ACCESS_KEY: vault:secret/data/${site}/aws/config#AWS_SECRET_ACCESS_KEY
|
|
320
|
+
AWS_REGION: vault:secret/data/${site}/aws/config#AWS_REGION`
|
|
321
|
+
: '';
|
|
322
|
+
|
|
314
323
|
// Prepare cc.app.yaml
|
|
315
|
-
const
|
|
324
|
+
const uiCCAppYaml = `
|
|
316
325
|
repo: docupace-ui-main
|
|
317
|
-
revision:
|
|
326
|
+
revision: ${revision}
|
|
318
327
|
`.trim();
|
|
319
328
|
// Prepare cc.values.yaml
|
|
320
|
-
const
|
|
329
|
+
const uiCCValuesYaml = `
|
|
321
330
|
uiMain:
|
|
322
331
|
auth0BaseUrl: https://${ccUrl}
|
|
323
332
|
auth0IssuerBaseUrl: https://${auth0Domain}
|
|
@@ -329,13 +338,7 @@ uiMain:
|
|
|
329
338
|
env:
|
|
330
339
|
AUTH0_AUDIENCE: core-api-access
|
|
331
340
|
AUTH0_CLIENT_SECRET: vault:secret/data/${site}/ui-cc/config#AUTH0_CLIENT_SECRET
|
|
332
|
-
AUTH0_SECRET: vault:secret/data/${site}/ui-cc/config#AUTH0_SECRET
|
|
333
|
-
${
|
|
334
|
-
useS3 === true || useS3 === 'true'
|
|
335
|
-
? `
|
|
336
|
-
AWS_ACCESS_KEY_ID: vault:secret/data/${site}/aws/config#AWS_ACCESS_KEY_ID
|
|
337
|
-
AWS_BUCKET_NAME: vault:secret/data/${site}/aws/config#AWS_BUCKET_NAME
|
|
338
|
-
AWS_SECRET_ACCESS_KEY: vault:secret/data/${site}/aws/config#AWS_SECRET_ACCESS_KEY
|
|
341
|
+
AUTH0_SECRET: vault:secret/data/${site}/ui-cc/config#AUTH0_SECRET${awsS3Vars ? '\n ' + awsS3Vars.trim() : ''}
|
|
339
342
|
image:
|
|
340
343
|
repository: registry.paperout.com/docupace-ui-main-${env}-docker-local/cc-ui-app
|
|
341
344
|
tag: ${imageTag}
|
|
@@ -358,52 +361,45 @@ ingress:
|
|
|
358
361
|
- hosts:
|
|
359
362
|
- ${ccUrl}
|
|
360
363
|
secretName: dp-cc-ui-cert
|
|
361
|
-
`.trim()
|
|
362
|
-
: ''
|
|
363
|
-
}
|
|
364
364
|
${
|
|
365
|
-
|
|
366
|
-
|
|
365
|
+
useS3 === true || useS3 === 'true'
|
|
366
|
+
? `
|
|
367
367
|
serviceAccount:
|
|
368
368
|
create: true
|
|
369
369
|
annotations:
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
: ''
|
|
373
|
-
}
|
|
374
|
-
`.trim();
|
|
370
|
+
"helm.sh/hook": pre-install
|
|
371
|
+
"helm.sh/hook-weight": "-10"
|
|
372
|
+
eks.amazonaws.com/role-arn: arn:aws:iam::${siteAWSSecrets.AWS_ACCOUNT_ID}:role/eks-pod-identity-connect-next-${env}-${site}-bucket`.trim() : ''}`.trim();
|
|
375
373
|
|
|
376
374
|
console.log('Writing configuration files...');
|
|
377
375
|
await ensureDirectoryExists(path.resolve(`${repoPath}/dp/${site}`));
|
|
378
376
|
|
|
379
377
|
await fs.writeFile(
|
|
380
378
|
`${repoPath}/dp/${site}/cc.app.yaml`,
|
|
381
|
-
|
|
379
|
+
uiCCAppYaml,
|
|
382
380
|
(err) => {
|
|
383
381
|
if (err) {
|
|
384
|
-
console.error(
|
|
382
|
+
console.error(`Failed to write ${repoPath}/dp/${site}/cc.app.yaml file:`, err);
|
|
385
383
|
} else {
|
|
386
|
-
console.log(
|
|
384
|
+
console.log(`File ${repoPath}/dp/${site}/cc.app.yaml written successfully.`);
|
|
387
385
|
}
|
|
388
386
|
},
|
|
389
387
|
);
|
|
390
388
|
|
|
391
389
|
await fs.writeFile(
|
|
392
390
|
`${repoPath}/dp/${site}/cc.values.yaml`,
|
|
393
|
-
|
|
391
|
+
uiCCValuesYaml,
|
|
394
392
|
(err) => {
|
|
395
393
|
if (err) {
|
|
396
|
-
console.error(
|
|
394
|
+
console.error(`Failed to write ${repoPath}/dp/${site}/cc.values.yaml file:`, err);
|
|
397
395
|
} else {
|
|
398
|
-
console.log(
|
|
396
|
+
console.log(`File ${repoPath}/dp/${site}/cc.values.yaml written successfully.`);
|
|
399
397
|
}
|
|
400
398
|
},
|
|
401
399
|
);
|
|
402
|
-
console.log('
|
|
403
|
-
console.log('Updating Core Site Config...');
|
|
404
|
-
await updateCoreSiteConfig(site, env, useS3);
|
|
400
|
+
console.log('CC-UI configuration is done!');
|
|
405
401
|
} catch (error) {
|
|
406
|
-
console.error('Error configuring UI:', error);
|
|
402
|
+
console.error('Error configuring CC-UI:', error);
|
|
407
403
|
}
|
|
408
404
|
}
|
|
409
405
|
|
|
@@ -418,12 +414,12 @@ export async function cleanAndWritePropertiesFile(configPath, content) {
|
|
|
418
414
|
await fs.writeFile(configPath, cleanedContent, 'utf8');
|
|
419
415
|
console.log(`Cleaned and written file to: ${configPath}`);
|
|
420
416
|
} catch (error) {
|
|
421
|
-
console.error(
|
|
417
|
+
console.error(`Error writing properties file to ${configPath}:`, error.message);
|
|
422
418
|
process.exit(1);
|
|
423
419
|
}
|
|
424
420
|
}
|
|
425
421
|
|
|
426
|
-
export async function updateCoreSiteConfig(site, env,
|
|
422
|
+
export async function updateCoreSiteConfig(site, env, useS3Ui, useS3Gq) {
|
|
427
423
|
try {
|
|
428
424
|
const coreSiteEnv = coreSiteEnvMap[env];
|
|
429
425
|
|
|
@@ -439,7 +435,7 @@ export async function updateCoreSiteConfig(site, env, useS3) {
|
|
|
439
435
|
|
|
440
436
|
let siteAWSSecrets = null;
|
|
441
437
|
|
|
442
|
-
if (
|
|
438
|
+
if (useS3Ui === true || useS3Ui === 'true' || useS3Gq === true || useS3Gq === 'true') {
|
|
443
439
|
const siteAWSSecretsPath = getVaultSecretsConfigs(site).awsSecretsPath;
|
|
444
440
|
siteAWSSecrets = await getVaultSecrets(siteAWSSecretsPath);
|
|
445
441
|
console.log(`siteAWSSecretsPath => ${siteAWSSecretsPath}`);
|
|
@@ -447,14 +443,11 @@ export async function updateCoreSiteConfig(site, env, useS3) {
|
|
|
447
443
|
|
|
448
444
|
const coreSiteConfig = `
|
|
449
445
|
${
|
|
450
|
-
|
|
451
|
-
|
|
446
|
+
siteAWSSecrets
|
|
447
|
+
? `
|
|
452
448
|
com.docupace.imports.files.FilesImportConfig.aws.accessKeyId=${siteAWSSecrets.AWS_ACCESS_KEY_ID}
|
|
453
449
|
com.docupace.imports.files.FilesImportConfig.aws.accessKeySecret=${siteAWSSecrets.AWS_SECRET_ACCESS_KEY}
|
|
454
|
-
com.docupace.imports.files.FilesImportConfig.aws.region=${siteAWSSecrets.AWS_REGION}
|
|
455
|
-
`.trim()
|
|
456
|
-
: ''
|
|
457
|
-
}
|
|
450
|
+
com.docupace.imports.files.FilesImportConfig.aws.region=${siteAWSSecrets.AWS_REGION}`.trim() : ''}
|
|
458
451
|
`;
|
|
459
452
|
|
|
460
453
|
await fs.ensureDir(path.join(coreSiteConfigRepoPath, site.toUpperCase()));
|
|
@@ -481,9 +474,11 @@ async function configureGraphQLServer(
|
|
|
481
474
|
auth0Token,
|
|
482
475
|
vaultSiteSecretsPath,
|
|
483
476
|
imageTag,
|
|
477
|
+
revision,
|
|
484
478
|
standardConfigRemoteBranch,
|
|
485
479
|
repoPath,
|
|
486
480
|
commonSecrets,
|
|
481
|
+
useS3,
|
|
487
482
|
) {
|
|
488
483
|
siteHost = siteHost.replace('https://', '');
|
|
489
484
|
coreURL = coreURL.replace('https://', '');
|
|
@@ -495,7 +490,7 @@ async function configureGraphQLServer(
|
|
|
495
490
|
const auth0Response = await axios.get(
|
|
496
491
|
`https://${auth0Domain}/api/v2/clients`,
|
|
497
492
|
{
|
|
498
|
-
headers: {
|
|
493
|
+
headers: {authorization: `Bearer ${auth0Token}`},
|
|
499
494
|
},
|
|
500
495
|
);
|
|
501
496
|
|
|
@@ -530,13 +525,28 @@ async function configureGraphQLServer(
|
|
|
530
525
|
|
|
531
526
|
await updateVaultSecrets(vaultSiteSecretsPath, graphQLServerSecretData);
|
|
532
527
|
|
|
533
|
-
|
|
528
|
+
let siteAWSSecrets = null;
|
|
529
|
+
|
|
530
|
+
if (useS3 === true || useS3 === 'true') {
|
|
531
|
+
const siteAWSSecretsPath = getVaultSecretsConfigs(site).awsSecretsPath;
|
|
532
|
+
siteAWSSecrets = await getVaultSecrets(siteAWSSecretsPath);
|
|
533
|
+
console.log(`siteAWSSecretsPath => ${siteAWSSecretsPath}`);
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
const awsS3Vars = (useS3 === true || useS3 === 'true')
|
|
537
|
+
? `
|
|
538
|
+
AWS_ACCESS_KEY_ID: vault:secret/data/${site}/aws/config#AWS_ACCESS_KEY_ID
|
|
539
|
+
AWS_S3_BUCKET_NAME: vault:secret/data/${site}/aws/config#AWS_BUCKET_NAME
|
|
540
|
+
AWS_SECRET_ACCESS_KEY: vault:secret/data/${site}/aws/config#AWS_SECRET_ACCESS_KEY
|
|
541
|
+
AWS_REGION: vault:secret/data/${site}/aws/config#AWS_REGION`.trim()
|
|
542
|
+
: '';
|
|
543
|
+
// Prepare graphql-server.app.yaml
|
|
534
544
|
const graphQLServerAppYaml = `
|
|
535
545
|
repo: docupace-graphql-server
|
|
536
|
-
revision: ${
|
|
546
|
+
revision: ${revision}
|
|
537
547
|
`.trim();
|
|
538
548
|
|
|
539
|
-
// Prepare
|
|
549
|
+
// Prepare graphql-server.values.yaml
|
|
540
550
|
const graphQLServerValuesYaml = `
|
|
541
551
|
graphqlServer:
|
|
542
552
|
auth0Domain: https://${auth0Domain}
|
|
@@ -552,7 +562,17 @@ graphqlServer:
|
|
|
552
562
|
STANDARD_CONFIG_REMOTE_PATH: vault:secret/data/common/config#STANDARD_CONFIG_REMOTE_PATH
|
|
553
563
|
SITE_CONFIG_REMOTE_PATH: vault:secret/data/${site}/common/config#SITE_CONFIG_REMOTE_PATH
|
|
554
564
|
AUTH0_CC_CLIENT_ID: vault:secret/data/${site}/graphql-server/config#AUTH0_CC_CLIENT_ID
|
|
555
|
-
AUTH0_CC_CLIENT_SECRET: vault:secret/data/${site}/graphql-server/config#AUTH0_CC_CLIENT_SECRET
|
|
565
|
+
AUTH0_CC_CLIENT_SECRET: vault:secret/data/${site}/graphql-server/config#AUTH0_CC_CLIENT_SECRET${awsS3Vars ? '\n ' + awsS3Vars.trim() : ''}
|
|
566
|
+
${
|
|
567
|
+
useS3 === true || useS3 === 'true'
|
|
568
|
+
? `
|
|
569
|
+
serviceAccount:
|
|
570
|
+
create: true
|
|
571
|
+
annotations:
|
|
572
|
+
"helm.sh/hook": pre-install
|
|
573
|
+
"helm.sh/hook-weight": "-10"
|
|
574
|
+
eks.amazonaws.com/role-arn: arn:aws:iam::${siteAWSSecrets.AWS_ACCOUNT_ID}:role/eks-pod-identity-connect-next-${env}-${site}-bucket`.trim()
|
|
575
|
+
: ''}
|
|
556
576
|
image:
|
|
557
577
|
repository: registry.paperout.com/docupace-graphql-server-${env}-docker-local/docupace-graphql-server
|
|
558
578
|
tag: ${imageTag}
|
|
@@ -574,8 +594,7 @@ ingress:
|
|
|
574
594
|
tls:
|
|
575
595
|
- hosts:
|
|
576
596
|
- ${siteHost}
|
|
577
|
-
secretName: dp-next-ui-cert
|
|
578
|
-
`.trim();
|
|
597
|
+
secretName: dp-next-ui-cert`.trim();
|
|
579
598
|
|
|
580
599
|
// Write configuration files
|
|
581
600
|
console.log('Writing ArgoCD GraphQL Server configuration files...');
|
|
@@ -598,13 +617,13 @@ ingress:
|
|
|
598
617
|
graphQLServerValuesYaml,
|
|
599
618
|
(err) => {
|
|
600
619
|
if (err) {
|
|
601
|
-
console.error(
|
|
620
|
+
console.error(`Failed to write ${repoPath}/dp/${site}/graphql-server.values.yaml file:`, err);
|
|
602
621
|
} else {
|
|
603
|
-
console.log(
|
|
622
|
+
console.log(`File ${repoPath}/dp/${site}/graphql-server.values.yaml written successfully.`);
|
|
604
623
|
}
|
|
605
624
|
},
|
|
606
625
|
);
|
|
607
|
-
console.log('
|
|
626
|
+
console.log('GraphQL Server configuration is done!');
|
|
608
627
|
} catch (error) {
|
|
609
628
|
console.error('Error configuring GraphQL Server:', error);
|
|
610
629
|
}
|
|
@@ -618,8 +637,9 @@ export async function configureFromSite(
|
|
|
618
637
|
deployUI,
|
|
619
638
|
deployGraphQLServer,
|
|
620
639
|
useNewDomain,
|
|
621
|
-
|
|
640
|
+
useS3Ui,
|
|
622
641
|
deployCCUI,
|
|
642
|
+
useS3Gq,
|
|
623
643
|
) {
|
|
624
644
|
console.log(
|
|
625
645
|
`Configuring Auth0 tenants and ArgoCD apps for site: ${toSite} in env: ${toEnv} from site: ${fromSite}`,
|
|
@@ -673,20 +693,61 @@ export async function configureFromSite(
|
|
|
673
693
|
// const auth0RepoPath = await cloneRepository('auth0-site-setup');
|
|
674
694
|
|
|
675
695
|
// Read deploy configs
|
|
676
|
-
const {
|
|
696
|
+
const {deployConfig: deployUIConfig} = await readDeployConfig(
|
|
677
697
|
'ui',
|
|
678
698
|
fromEnv,
|
|
679
699
|
fromSite,
|
|
680
700
|
'values',
|
|
681
701
|
);
|
|
702
|
+
const {deployConfig: deployUiRevisionConfig} = await readDeployConfig(
|
|
703
|
+
'ui',
|
|
704
|
+
fromEnv,
|
|
705
|
+
fromSite,
|
|
706
|
+
'app',
|
|
707
|
+
);
|
|
708
|
+
|
|
682
709
|
const uiImageTag = deployUIConfig.image.tag;
|
|
710
|
+
const uiRevision = deployUiRevisionConfig.revision;
|
|
711
|
+
|
|
712
|
+
console.log(`Copying Latest UI Revision: ${uiRevision}`);
|
|
683
713
|
|
|
684
|
-
const {
|
|
714
|
+
const {deployConfig: deployCCConfig} = await readDeployConfig(
|
|
715
|
+
'cc',
|
|
716
|
+
fromEnv,
|
|
717
|
+
fromSite,
|
|
718
|
+
'values',
|
|
719
|
+
);
|
|
720
|
+
|
|
721
|
+
const {deployConfig: deployCCRevisionConfig} = await readDeployConfig(
|
|
722
|
+
'cc',
|
|
723
|
+
fromEnv,
|
|
724
|
+
fromSite,
|
|
725
|
+
'app',
|
|
726
|
+
);
|
|
727
|
+
|
|
728
|
+
const ccImageTag = deployCCConfig.image.tag;
|
|
729
|
+
const ccRevision = deployCCRevisionConfig.revision;
|
|
730
|
+
|
|
731
|
+
console.log(`Copying Latest CC Revision: ${uiRevision}`);
|
|
732
|
+
|
|
733
|
+
const {deployConfig: deployGraphQLServerConfig} = await readDeployConfig(
|
|
685
734
|
'graphql-server',
|
|
686
735
|
fromEnv,
|
|
687
736
|
fromSite,
|
|
688
737
|
'values',
|
|
689
738
|
);
|
|
739
|
+
|
|
740
|
+
const {deployConfig: deployGraphQLServerRevisionConfig} = await readDeployConfig(
|
|
741
|
+
'graphql-server',
|
|
742
|
+
fromEnv,
|
|
743
|
+
fromSite,
|
|
744
|
+
'app',
|
|
745
|
+
);
|
|
746
|
+
|
|
747
|
+
const gqRevision = deployGraphQLServerRevisionConfig.revision;
|
|
748
|
+
|
|
749
|
+
console.log(`Copying Latest GQ Server Revision: ${gqRevision}`);
|
|
750
|
+
|
|
690
751
|
const graphqlImageTag = deployGraphQLServerConfig.image.tag;
|
|
691
752
|
const graphqlStandardConfigRemoteBranch =
|
|
692
753
|
deployGraphQLServerConfig.graphqlServer.standardConfigRemoteBranch;
|
|
@@ -700,7 +761,11 @@ export async function configureFromSite(
|
|
|
700
761
|
|
|
701
762
|
const envConfig = environmentConfig[toEnv];
|
|
702
763
|
|
|
703
|
-
let CORE_URL,
|
|
764
|
+
let CORE_URL,
|
|
765
|
+
SITE_HOST,
|
|
766
|
+
CORE_API_CONTEXT,
|
|
767
|
+
CONNECT_URL,
|
|
768
|
+
DOCUPACE_HOST;
|
|
704
769
|
const newUrl = envConfig.newUrl(toSite);
|
|
705
770
|
const ccUrl = envConfig.ccUrl(toSite);
|
|
706
771
|
|
|
@@ -735,8 +800,9 @@ export async function configureFromSite(
|
|
|
735
800
|
auth0Token,
|
|
736
801
|
uiSecretsPath,
|
|
737
802
|
uiImageTag,
|
|
803
|
+
uiRevision,
|
|
738
804
|
repoPathToEnv,
|
|
739
|
-
|
|
805
|
+
useS3Ui,
|
|
740
806
|
);
|
|
741
807
|
}
|
|
742
808
|
|
|
@@ -753,9 +819,10 @@ export async function configureFromSite(
|
|
|
753
819
|
auth0ClientSecret,
|
|
754
820
|
auth0Token,
|
|
755
821
|
ccUISecretsPath,
|
|
756
|
-
|
|
822
|
+
ccImageTag,
|
|
823
|
+
ccRevision,
|
|
757
824
|
repoPathToEnv,
|
|
758
|
-
|
|
825
|
+
useS3Ui,
|
|
759
826
|
ccUrl,
|
|
760
827
|
);
|
|
761
828
|
}
|
|
@@ -772,10 +839,15 @@ export async function configureFromSite(
|
|
|
772
839
|
auth0Token,
|
|
773
840
|
graphqlSecretsPath,
|
|
774
841
|
graphqlImageTag,
|
|
842
|
+
gqRevision,
|
|
775
843
|
graphqlStandardConfigRemoteBranch,
|
|
776
844
|
repoPathToEnv,
|
|
777
845
|
commonSecrets,
|
|
846
|
+
useS3Gq,
|
|
778
847
|
);
|
|
848
|
+
|
|
849
|
+
console.log('Updating Core Site Config...');
|
|
850
|
+
await updateCoreSiteConfig(toSite, toEnv, useS3Ui, useS3Gq);
|
|
779
851
|
await pushDeployConfig(
|
|
780
852
|
repoPathToEnv,
|
|
781
853
|
`Config update for ${toSite} from ${fromSite} with UI: ${uiImageTag} and GraphQL: ${graphqlImageTag}`,
|