@docupace/pipeline 1.0.1-2.ervins.1 → 1.0.1-2.ervins.11

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docupace/pipeline",
3
- "version": "1.0.12.ervins.1",
3
+ "version": "1.0.12.ervins.11",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -278,6 +278,7 @@ async function getAuth0AuthToken(auth0Domain, clientId, clientSecret) {
278
278
 
279
279
  async function configureUI(siteHost, coreURL, docupaceHost, site, env, useNewDomain, auth0Domain, auth0ClientId, auth0ClientSecret, auth0Token, vaultSiteSecretsPath, imageTag, repoPath) {
280
280
  console.log(`Configuring UI for site: ${site} Host: ${siteHost} in env: ${env}`);
281
+ siteHost = siteHost.replace('https://', '');
281
282
 
282
283
  try {
283
284
  const auth0Response = await axios.get(`https://${auth0Domain}/api/v2/clients`, {
@@ -406,6 +407,8 @@ externalConnectService:
406
407
 
407
408
  async function configureGraphQLServer(siteHost, coreURL, docupaceHost, site, env, auth0Domain, auth0ClientId, auth0ClientSecret, auth0Token, vaultSiteSecretsPath, imageTag, standardConfigRemoteBranch, repoPath, commonSecrets) {
408
409
  console.log(`Configuring GraphQL Server for site: ${site} Host: ${siteHost} in env: ${env}`);
410
+ siteHost = siteHost.replace('https://', '');
411
+
409
412
 
410
413
  try {
411
414
  const auth0Response = await axios.get(`https://${auth0Domain}/api/v2/clients`, {
@@ -508,7 +511,7 @@ ingress:
508
511
  }
509
512
  }
510
513
 
511
- export async function configureFromSite(fromSite, toSite, env,fromEnv,toEnv, deployUI, deployGraphQLServer, useNewDomain) {
514
+ export async function configureFromSite(fromSite, toSite, env, deployUI, deployGraphQLServer, useNewDomain) {
512
515
  console.log(`Configuring Auth0 tenants and ArgoCD apps for site: ${toSite} in env: ${env} from site: ${fromSite}`);
513
516
  // Common Secrets
514
517
  const commonSecretsPath = getVaultSecretsConfigs(toSite).commonSecretsPath;
@@ -19,18 +19,22 @@ export async function addApacheSite() {
19
19
  log('Error: HAPROXY_PRIVATE_KEY not set.');
20
20
  process.exit(1);
21
21
  }
22
-
23
- await fs.writeFile('private.key', haproxyPrivateKey);
22
+
23
+ await fs.writeFile('private.key', Buffer.from(haproxyPrivateKey, 'base64'));
24
24
  await fs.chmod('private.key', 0o600);
25
25
 
26
- const server = `${process.env.ENVIRONMENT}-apalb01a.corp.docupace.com`;
26
+
27
27
  console.log("Running command");
28
- const sshCmd = (script) =>
28
+ const sshCmd = (server,script) =>
29
29
  $`ssh -i private.key -o StrictHostKeyChecking=no root@${server} ${script}`;
30
30
 
31
+ let server = `${process.env.ENVIRONMENT}-apalb01a.corp.docupace.com`;
31
32
  // The script is run twice in the Bash version
32
- await sshCmd(`/root/repo/iis-preprod/scripts/addsite/add_core_site.sh ${process.env.ENVIRONMENT} ${process.env.SITE}`);
33
- //await sshCmd(`/root/repo/iis-preprod/scripts/addsite/add_core_site.sh ${process.env.ENVIRONMENT} ${process.env.SITE}`);
33
+ await sshCmd(server, `/root/repo/iis-preprod/scripts/addsite/add_core_site.sh ${process.env.ENVIRONMENT} ${process.env.SITE}`);
34
+
35
+ server = `${process.env.ENVIRONMENT}-apalb01b.corp.docupace.com`;
36
+
37
+ await sshCmd(server,`/root/repo/iis-preprod/scripts/addsite/add_core_site.sh ${process.env.ENVIRONMENT} ${process.env.SITE}`);
34
38
  }
35
39
 
36
40