@docupace/pipeline 1.0.7-7.micro-cli12 → 1.0.7-alpha.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/.prettierrc.cjs +12 -12
- package/bin/next-changeset-validate.sh +8 -8
- package/eslint.config.js +26 -49
- package/next/changeset.sh +75 -75
- package/next/copy.sh +34 -34
- package/next/deploy.sh +40 -40
- package/next/execute.sh +117 -123
- package/next/sonar.sh +23 -23
- package/package.json +7 -23
- package/src/changeset/cli.js +281 -237
- package/src/changeset/validate.js +47 -91
- package/src/jenkins/setParams.groovy +59 -58
- package/src/next/cli.js +15 -111
- package/src/next/config.js +72 -137
- package/src/next/copy.js +30 -61
- package/src/next/deploy.js +314 -633
- package/src/next/jenkins.js +88 -123
- package/src/next/pipline.js +115 -114
- package/src/next/publish.js +48 -71
- package/src/next/pull.js +7 -7
- package/src/next/sonar.js +23 -23
- package/README.md +0 -136
- package/bin/azuread_update_callbacks_for_app.sh +0 -58
- package/bitbucket-pipelines.yml +0 -60
- package/jest.config.js +0 -15
- package/src/auth0/alias.js +0 -79
- package/src/auth0/alias.test.js +0 -172
- package/src/auth0/cli.js +0 -82
- package/src/auth0/configure.js +0 -902
- package/src/auth0/configure.test.js +0 -167
- package/src/auth0/export.js +0 -48
- package/src/auth0/export.test.js +0 -103
- package/src/auth0/metadata.js +0 -141
- package/src/auth0/metadata.test.js +0 -186
- package/src/auth0/vault.js +0 -60
- package/src/auth0/vault.test.js +0 -134
- package/src/changeset/changelog-wiki.js +0 -328
- package/src/changeset/changeset-config.js +0 -34
- package/src/changeset/create.js +0 -215
- package/src/changeset/package-util.js +0 -87
- package/src/changeset/util.js +0 -43
- package/src/changeset/version.js +0 -102
- package/src/lib/merge-driver.js +0 -204
- package/src/merge/cli-merge-all.js +0 -507
- package/src/merge/cli-merge.js +0 -492
- package/src/merge/cli-resolve.js +0 -399
- package/src/merge/cli.js +0 -38
- package/src/merge/merge-changelog.js +0 -87
- package/src/merge/merge-package.js +0 -106
- package/src/merge/merge-types.js +0 -82
- package/src/merge/pr.js +0 -231
- package/src/micro/cli.js +0 -51
- package/src/micro/ms-deploy.js +0 -451
- package/src/micro/ms-publish.js +0 -186
- package/src/next/alias.js +0 -53
- package/src/next/apache.js +0 -81
- package/src/next/connect.js +0 -226
- package/src/next/git-to-semver.js +0 -79
- package/src/next/haproxy.js +0 -76
- package/src/next/jira.js +0 -84
- package/src/next/logger.js +0 -17
- package/src/next/test.js +0 -5
- package/src/next/util.js +0 -93
- package/src/next/vault.js +0 -45
- package/terraform/apply.sh +0 -37
- package/terraform/init.sh +0 -72
- package/terraform/plan.sh +0 -76
- package/terraform/validate.sh +0 -17
|
@@ -1,91 +1,47 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export async function validateChangesetPath(directoryPath) {
|
|
49
|
-
try {
|
|
50
|
-
// Step 1: Read the directory for md files excluding README.md
|
|
51
|
-
const allFiles = fs.readdirSync(directoryPath);
|
|
52
|
-
const mdFiles = allFiles.filter(
|
|
53
|
-
(file) => file.endsWith('.md') && file !== 'README.md',
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
// Step 2: Check for pre.json and parse it
|
|
57
|
-
const preJsonPath = path.join(directoryPath, 'pre.json');
|
|
58
|
-
let preJson;
|
|
59
|
-
|
|
60
|
-
if (!fs.existsSync(preJsonPath) && mdFiles.length === 0) {
|
|
61
|
-
throw new Error('Error: No pre.json and no md files found.');
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
if (fs.existsSync(preJsonPath)) {
|
|
65
|
-
preJson = JSON.parse(fs.readFileSync(preJsonPath, 'utf-8'));
|
|
66
|
-
|
|
67
|
-
if (preJson.mode == 'pre') {
|
|
68
|
-
// Step 4a: Get list of changesets from pre.json
|
|
69
|
-
const changesets = preJson.changesets || [];
|
|
70
|
-
const changesetNames = changesets.map((change) => change);
|
|
71
|
-
|
|
72
|
-
// Step 4b: Match files with the list of changesets
|
|
73
|
-
const mdFileNamesWithoutExt = mdFiles.map((file) =>
|
|
74
|
-
path.basename(file, '.md'),
|
|
75
|
-
);
|
|
76
|
-
const unmatchedFiles = mdFileNamesWithoutExt.filter(
|
|
77
|
-
(fileName) => !changesetNames.includes(fileName),
|
|
78
|
-
);
|
|
79
|
-
|
|
80
|
-
if (unmatchedFiles.length == 0) {
|
|
81
|
-
throw new Error('Error: No new MD files found:');
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
console.log('Validation successful.');
|
|
87
|
-
} catch (error) {
|
|
88
|
-
console.log(error.message);
|
|
89
|
-
throw error;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
|
|
4
|
+
export async function validateChangesets(directoryPath) {
|
|
5
|
+
try {
|
|
6
|
+
// Step 1: Read the directory for md files excluding README.md
|
|
7
|
+
const allFiles = fs.readdirSync(directoryPath);
|
|
8
|
+
const mdFiles = allFiles.filter(
|
|
9
|
+
(file) => file.endsWith('.md') && file !== 'README.md',
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
// Step 2: Check for pre.json and parse it
|
|
13
|
+
const preJsonPath = path.join(directoryPath, 'pre.json');
|
|
14
|
+
let preJson;
|
|
15
|
+
|
|
16
|
+
if (!fs.existsSync(preJsonPath) && mdFiles.length === 0) {
|
|
17
|
+
throw new Error('Error: No pre.json and no md files found.');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (fs.existsSync(preJsonPath)) {
|
|
21
|
+
preJson = JSON.parse(fs.readFileSync(preJsonPath, 'utf-8'));
|
|
22
|
+
|
|
23
|
+
if (preJson.mode == 'pre') {
|
|
24
|
+
// Step 4a: Get list of changesets from pre.json
|
|
25
|
+
const changesets = preJson.changesets || [];
|
|
26
|
+
const changesetNames = changesets.map((change) => change);
|
|
27
|
+
|
|
28
|
+
// Step 4b: Match files with the list of changesets
|
|
29
|
+
const mdFileNamesWithoutExt = mdFiles.map((file) =>
|
|
30
|
+
path.basename(file, '.md'),
|
|
31
|
+
);
|
|
32
|
+
const unmatchedFiles = mdFileNamesWithoutExt.filter(
|
|
33
|
+
(fileName) => !changesetNames.includes(fileName),
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
if (unmatchedFiles.length == 0) {
|
|
37
|
+
throw new Error('Error: No new MD files found:');
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
console.log('Validation successful.');
|
|
43
|
+
} catch (error) {
|
|
44
|
+
console.log(error.message);
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -1,58 +1,59 @@
|
|
|
1
|
-
import groovy.json.JsonSlurper
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
def
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
def
|
|
9
|
-
def
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
def
|
|
17
|
-
def
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
if
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
jboss7controllerResult.remove("
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
jboss7controllerResult.remove("qa-
|
|
45
|
-
jboss7controllerResult.remove("
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
1
|
+
import groovy.json.JsonSlurper
|
|
2
|
+
|
|
3
|
+
import hudson.model.*;
|
|
4
|
+
|
|
5
|
+
def build = Thread.currentThread().executable
|
|
6
|
+
def params = build.getEnvironment(listener)
|
|
7
|
+
|
|
8
|
+
def site = params.get('site')
|
|
9
|
+
def server = "jboss7"
|
|
10
|
+
def environment = params.get('environment')
|
|
11
|
+
|
|
12
|
+
def buildFile=new File("D:\\Docupace\\CustomFolders\\" + environment + "\\" + site + "\\" + server + "\\buildApp.properties")
|
|
13
|
+
|
|
14
|
+
List<String> jboss7controllerResult = []
|
|
15
|
+
|
|
16
|
+
def controllersReport = new File("D:\\Docupace\\controllers_report.json")
|
|
17
|
+
def inputJSON = new JsonSlurper().parseText(controllersReport.text)
|
|
18
|
+
def props = new Properties()
|
|
19
|
+
buildFile.withInputStream { stream -> props.load(stream) }
|
|
20
|
+
def webRootContext = props["web.root.context"]
|
|
21
|
+
if (webRootContext == null || webRootContext =="core") webRootContext = props["docupace.config.client.id"].toLowerCase()
|
|
22
|
+
|
|
23
|
+
webRootContext = webRootContext.replaceFirst('_sso','')
|
|
24
|
+
def map = inputJSON.'content'
|
|
25
|
+
|
|
26
|
+
def Boolean enabled
|
|
27
|
+
|
|
28
|
+
map.each {k,v ->
|
|
29
|
+
v.each{vk, vv -> if (vk == webRootContext ) {
|
|
30
|
+
enabled = false
|
|
31
|
+
if(vv.deploymentsProperty.size()>0) enabled = vv.deploymentsProperty[0].isEnabled
|
|
32
|
+
if (enabled) jboss7controllerResult.push(k)
|
|
33
|
+
else jboss7controllerResult << k
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (jboss7controllerResult.size()>0) {
|
|
39
|
+
if (environment == 'preprod') {
|
|
40
|
+
jboss7controllerResult.remove("dev-corjbdc10.corp.docupace.com")
|
|
41
|
+
jboss7controllerResult.remove("usdoc-s-jbdc1.corp.docupace.com")
|
|
42
|
+
}
|
|
43
|
+
if (environment == 'dev') {
|
|
44
|
+
jboss7controllerResult.remove("qa-corjbdc10.corp.docupace.com")
|
|
45
|
+
jboss7controllerResult.remove("qa-corjbdc20.corp.docupace.com")
|
|
46
|
+
jboss7controllerResult.remove("usdoc-s-jbdc2.corp.docupace.com")
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
println jboss7controllerResult[0]
|
|
51
|
+
|
|
52
|
+
env.jboss7controller = jboss7controllerResult[0]
|
|
53
|
+
|
|
54
|
+
def serverGroup = inputJSON.'content'."${jboss7controller}"."${webRootContext}".'serverGroup'
|
|
55
|
+
|
|
56
|
+
println serverGroup
|
|
57
|
+
|
|
58
|
+
params.put("serverGroup", serverGroup)
|
|
59
|
+
|
package/src/next/cli.js
CHANGED
|
@@ -4,27 +4,19 @@ import { Command } from 'commander';
|
|
|
4
4
|
import { pull } from './pull.js';
|
|
5
5
|
import { sonar } from './sonar.js';
|
|
6
6
|
import { publish } from './publish.js';
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
deployTemplate,
|
|
11
|
-
getDefaultDeploySite,
|
|
12
|
-
getDeployTag,
|
|
13
|
-
} from './deploy.js';
|
|
14
|
-
import { 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';
|
|
7
|
+
import { deployFromSite } from './deploy.js';
|
|
8
|
+
import { deployTemplate } from './deploy.js';
|
|
9
|
+
import { copy } from './copy.js';
|
|
19
10
|
import dotenv from 'dotenv';
|
|
20
|
-
import { $ } from 'zx';
|
|
21
|
-
import { deployConnect, deployCore } from './jenkins.js';
|
|
22
|
-
import { runPipeline } from './pipline.js';
|
|
23
11
|
|
|
24
12
|
dotenv.config({ path: ['.env.pipeline.local', 'config/.env.pipeline.local'] });
|
|
25
13
|
|
|
26
14
|
const program = new Command();
|
|
27
15
|
|
|
16
|
+
// GIT SHA computation
|
|
17
|
+
import { $ } from 'zx';
|
|
18
|
+
import { deployCore } from './jenkins.js';
|
|
19
|
+
import { runPipeline } from './pipline.js';
|
|
28
20
|
const GIT_SHA = (await $`git log --pretty=format:'%h' -n 1`).stdout.trim();
|
|
29
21
|
|
|
30
22
|
program
|
|
@@ -41,40 +33,6 @@ program
|
|
|
41
33
|
await sonar(GIT_SHA);
|
|
42
34
|
});
|
|
43
35
|
|
|
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
36
|
program
|
|
79
37
|
.command('publish')
|
|
80
38
|
.description('Publish a Docker image')
|
|
@@ -90,60 +48,16 @@ program
|
|
|
90
48
|
.requiredOption('-F, --from-site <fromSite>', 'Source site')
|
|
91
49
|
.requiredOption('-T, --to-site <toSite>', 'Target site')
|
|
92
50
|
.option('-c, --deploy-core <deployCore>', 'Deploy Core', 'false')
|
|
93
|
-
.option('-C, --deploy-connect <deployConnect>', 'Deploy Connect', 'false')
|
|
94
51
|
.action(async (options) => {
|
|
95
|
-
const { fromEnv, fromSite, toEnv, toSite, deployCore
|
|
96
|
-
|
|
97
|
-
await deployFromSite(
|
|
98
|
-
fromEnv,
|
|
99
|
-
fromSite,
|
|
100
|
-
toEnv,
|
|
101
|
-
toSite,
|
|
102
|
-
deployCore,
|
|
103
|
-
deployConnect,
|
|
104
|
-
);
|
|
52
|
+
const { fromEnv, fromSite, toEnv, toSite, deployCore } = options;
|
|
53
|
+
await deployFromSite(fromEnv, fromSite, toEnv, toSite, deployCore);
|
|
105
54
|
});
|
|
106
55
|
|
|
107
56
|
program
|
|
108
|
-
.command('
|
|
109
|
-
.description('Deploy an standard configuration for configured sites')
|
|
110
|
-
.action(async (tagPrefix) => {
|
|
111
|
-
const deployTag = await getDeployTag(tagPrefix);
|
|
112
|
-
const sites = await getDefaultDeploySite(deployTag);
|
|
113
|
-
for (const { env, site } of sites) {
|
|
114
|
-
await deployTemplate(env, site, deployTag);
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
program
|
|
119
|
-
.command('deploy-site-config <env> <site> [tagPrefix]')
|
|
120
|
-
.description('Deploy site configuration for a specific site')
|
|
121
|
-
.action(async (env, site, tagPrefix) => {
|
|
122
|
-
const deployTag = await getDeployTag(tagPrefix);
|
|
123
|
-
await deployTemplate(env, site, deployTag, 'siteConfigRemoteBranch');
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
program
|
|
127
|
-
.command('deploy-app <application>')
|
|
57
|
+
.command('deployTemplate <site>')
|
|
128
58
|
.description('Deploy an application for a specific site')
|
|
129
|
-
.action(async (
|
|
130
|
-
|
|
131
|
-
const sites = await getDefaultDeploySite(deployTag);
|
|
132
|
-
for (const { env, site } of sites) {
|
|
133
|
-
await deployAppWithTag(application, env, site, deployTag);
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
program
|
|
138
|
-
.command('deploy-mono-app <tag> <application>')
|
|
139
|
-
.description('Deploy an mono application for a specific site')
|
|
140
|
-
.action(async (tag, application) => {
|
|
141
|
-
const deployTag = await getDeployTag(tag);
|
|
142
|
-
const version = 'v' + deployTag.split('@')[1];
|
|
143
|
-
const sites = await getDefaultDeploySite(version);
|
|
144
|
-
for (const { env, site } of sites) {
|
|
145
|
-
await deployAppWithTag(application, env, site, version);
|
|
146
|
-
}
|
|
59
|
+
.action(async (site) => {
|
|
60
|
+
await deployTemplate(site);
|
|
147
61
|
});
|
|
148
62
|
|
|
149
63
|
program
|
|
@@ -155,15 +69,6 @@ program
|
|
|
155
69
|
await deployCore(env, site, options.liquibase, options.branch);
|
|
156
70
|
});
|
|
157
71
|
|
|
158
|
-
program
|
|
159
|
-
.command('deploy-connect <env> <site>')
|
|
160
|
-
.description('Deploy Core')
|
|
161
|
-
.option('-l, --liquibase <liquibase>', 'Application name', 'true')
|
|
162
|
-
.option('-b, --branch <branch>', 'Branch', 'master')
|
|
163
|
-
.action(async (env, site, options) => {
|
|
164
|
-
await deployConnect(env, site, options.liquibase, options.branch);
|
|
165
|
-
});
|
|
166
|
-
|
|
167
72
|
program
|
|
168
73
|
.command('deploy-core-pipeline <env> <site>')
|
|
169
74
|
.description('Deploy Core')
|
|
@@ -181,14 +86,13 @@ program
|
|
|
181
86
|
program
|
|
182
87
|
.command('copy')
|
|
183
88
|
.description('Copy a Docker image between registries')
|
|
184
|
-
.requiredOption('-
|
|
89
|
+
.requiredOption('-a, --application <application>', 'Application name')
|
|
185
90
|
.requiredOption('-f, --from-env <fromEnv>', 'Source environment')
|
|
186
91
|
.requiredOption('-t, --to-env <toEnv>', 'Target environment')
|
|
187
92
|
.requiredOption('-g, --tag <tag>', 'Image tag')
|
|
188
|
-
.requiredOption('-a, --application <application>', 'Application name')
|
|
189
93
|
.action(async (options) => {
|
|
190
|
-
const {
|
|
191
|
-
await
|
|
94
|
+
const { application, fromEnv, toEnv, tag } = options;
|
|
95
|
+
await copy(application, fromEnv, toEnv, tag);
|
|
192
96
|
});
|
|
193
97
|
|
|
194
98
|
program
|
package/src/next/config.js
CHANGED
|
@@ -1,137 +1,72 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
newUrl: (site) =>
|
|
10
|
-
oldUrl: (site) => `https://www.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
if (config.image.repository.endsWith('/docupace-ui-main')) {
|
|
74
|
-
const tag = config.image.tag;
|
|
75
|
-
const version = tag.startsWith('v') ? tag.slice(1) : tag;
|
|
76
|
-
if (semver.gt(version, UI_MONO_VERSION)) {
|
|
77
|
-
const parts = config.image.repository.split('/');
|
|
78
|
-
parts[2] = 'enterprise-ui-app';
|
|
79
|
-
config.image.repository = parts.join('/');
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
return config;
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
export const getEnvInfo = () => {
|
|
88
|
-
const envInfo = Object.fromEntries(
|
|
89
|
-
environments.map((env) => [
|
|
90
|
-
env,
|
|
91
|
-
{
|
|
92
|
-
jfrog: {
|
|
93
|
-
username: process.env[`JF_REGISTRY_${env.toUpperCase()}_USERNAME`],
|
|
94
|
-
password: process.env[`JF_REGISTRY_${env.toUpperCase()}_PASSWORD`],
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
]),
|
|
98
|
-
);
|
|
99
|
-
|
|
100
|
-
return envInfo;
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
export const getBitbucketInfo = () => {
|
|
104
|
-
return {
|
|
105
|
-
username: process.env.BITBUCKET_USERNAME,
|
|
106
|
-
password: process.env.BITBUCKET_APP_PASSWORD,
|
|
107
|
-
workspace: 'dp-cloud',
|
|
108
|
-
};
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
export const getRepUrl = (repoName) => {
|
|
112
|
-
const { username, password, workspace } = getBitbucketInfo();
|
|
113
|
-
return `https://${username}:${password}@bitbucket.org/${workspace}/${repoName}.git`;
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
export const jfRegistryUrl = 'registry.paperout.com';
|
|
117
|
-
|
|
118
|
-
export const getVaultSecretsConfigs = (site) => {
|
|
119
|
-
return {
|
|
120
|
-
commonSecretsPath: 'secret/data/common/config',
|
|
121
|
-
siteCommonSecretsPath: `secret/data/${site}/common/config`,
|
|
122
|
-
graphqlServerSecretsPath: `secret/data/${site}/graphql-server/config`,
|
|
123
|
-
uiSecretsPath: `secret/data/${site}/ui/config`,
|
|
124
|
-
ccUISecretsPath: `secret/data/${site}/ui-cc/config`,
|
|
125
|
-
awsSecretsPath: `secret/data/${site}/aws/config`,
|
|
126
|
-
};
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
export const coreSiteEnvMap = {
|
|
130
|
-
dev: 'dev',
|
|
131
|
-
qa: 'preprod',
|
|
132
|
-
stg: 'staging',
|
|
133
|
-
stage: 'staging',
|
|
134
|
-
uat: 'uat',
|
|
135
|
-
prd: 'prod',
|
|
136
|
-
prod: 'prod',
|
|
137
|
-
};
|
|
1
|
+
export const environments = ['dev', 'qa', 'uat', 'stage', 'prod'];
|
|
2
|
+
|
|
3
|
+
export const environmentConfig = {
|
|
4
|
+
dev: {
|
|
5
|
+
newUrl: (site) => `${site}.dev.dpai.tech`,
|
|
6
|
+
oldUrl: (site) => `https://www.dev.docupaceinc.com/${site}`,
|
|
7
|
+
},
|
|
8
|
+
qa: {
|
|
9
|
+
newUrl: (site) => `${site}.qa.dpai.tech`,
|
|
10
|
+
oldUrl: (site) => `https://www.preprod.docupaceinc.com/${site}`,
|
|
11
|
+
},
|
|
12
|
+
uat: {
|
|
13
|
+
newUrl: (site) => `${site}.qa.dpai.tech`,
|
|
14
|
+
oldUrl: (site) => `https://www2.paperout.com/${site}_uat`,
|
|
15
|
+
},
|
|
16
|
+
stage: {
|
|
17
|
+
newUrl: (site) => `${site}.stage.dpai.tech`,
|
|
18
|
+
oldUrl: (site) => `https://www2.paperout.com/${site}_staging`,
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
prod: {
|
|
22
|
+
newUrl: (site) => `${site}.dpai.tech`,
|
|
23
|
+
oldUrl: (site) => `https://www2.paperout.com/${site}`,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const appInfo = {
|
|
28
|
+
'graphql-server': {
|
|
29
|
+
repositoryName: 'docupace-graphql-server',
|
|
30
|
+
deployAttributes: [
|
|
31
|
+
'image.tag',
|
|
32
|
+
'graphqlServer.siteConfigRemoteBranch',
|
|
33
|
+
'graphqlServer.standardConfigRemoteBranch',
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
ui: {
|
|
37
|
+
repositoryName: 'docupace-ui-main',
|
|
38
|
+
deployAttributes: ['image.tag'],
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const getEnvInfo = () => {
|
|
43
|
+
const envInfo = Object.fromEntries(
|
|
44
|
+
environments.map((env) => [
|
|
45
|
+
env,
|
|
46
|
+
{
|
|
47
|
+
jfrog: {
|
|
48
|
+
username: process.env[`JF_REGISTRY_${env.toUpperCase()}_USERNAME`],
|
|
49
|
+
password: process.env[`JF_REGISTRY_${env.toUpperCase()}_PASSWORD`],
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
]),
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
return envInfo;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export const getBitbucketInfo = () => {
|
|
59
|
+
return {
|
|
60
|
+
username: process.env.BITBUCKET_USERNAME,
|
|
61
|
+
password: process.env.BITBUCKET_APP_PASSWORD,
|
|
62
|
+
workspace: 'dp-cloud',
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export const getRepUrl = (repoName) => {
|
|
67
|
+
const { username, password, workspace } = getBitbucketInfo();
|
|
68
|
+
const repoUrl = `https://${username}:${password}@bitbucket.org/${workspace}/${repoName}.git`;
|
|
69
|
+
return repoUrl;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const jfRegistryUrl = 'registry.paperout.com';
|