@docupace/pipeline 1.0.34 → 1.0.35-matttest.0
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/configure.js +9 -1
- package/src/next/cli.js +29 -4
- package/src/next/deploy.js +16 -8
package/package.json
CHANGED
package/src/auth0/configure.js
CHANGED
|
@@ -107,6 +107,14 @@ async function configureUI(
|
|
|
107
107
|
|
|
108
108
|
await updateVaultSecrets(vaultSiteSecretsPath, uiSecretData);
|
|
109
109
|
|
|
110
|
+
let siteAWSSecrets = null;
|
|
111
|
+
|
|
112
|
+
if (useS3 === true || useS3 === 'true') {
|
|
113
|
+
const siteAWSSecretsPath = getVaultSecretsConfigs(site).awsSecretsPath;
|
|
114
|
+
siteAWSSecrets = await getVaultSecrets(siteAWSSecretsPath);
|
|
115
|
+
console.log(`siteAWSSecretsPath => ${siteAWSSecretsPath}`);
|
|
116
|
+
}
|
|
117
|
+
|
|
110
118
|
// Prepare ui.app.yaml
|
|
111
119
|
const uiAppYaml = `
|
|
112
120
|
repo: docupace-ui-main
|
|
@@ -144,7 +152,7 @@ ${
|
|
|
144
152
|
serviceAccount:
|
|
145
153
|
create: true
|
|
146
154
|
annotations:
|
|
147
|
-
eks.amazonaws.com/role-arn: arn:aws:iam
|
|
155
|
+
eks.amazonaws.com/role-arn: arn:aws:iam::${siteAWSSecrets.AWS_ACCOUNT_ID}:role/eks-pod-identity-connect-next-${env}-${site}-bucket
|
|
148
156
|
`.trim()
|
|
149
157
|
: ''
|
|
150
158
|
}
|
package/src/next/cli.js
CHANGED
|
@@ -4,7 +4,12 @@ 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 {
|
|
7
|
+
import {
|
|
8
|
+
deployAppWithTag,
|
|
9
|
+
deployFromSite,
|
|
10
|
+
getDefaultDeploySite,
|
|
11
|
+
getDeployTag,
|
|
12
|
+
} from './deploy.js';
|
|
8
13
|
import { deployTemplate } from './deploy.js';
|
|
9
14
|
import { copy } from './copy.js';
|
|
10
15
|
import { vaultAddSiteData } from './vault.js';
|
|
@@ -101,10 +106,30 @@ program
|
|
|
101
106
|
});
|
|
102
107
|
|
|
103
108
|
program
|
|
104
|
-
.command('
|
|
109
|
+
.command('deploy-template')
|
|
105
110
|
.description('Deploy an application for a specific site')
|
|
106
|
-
.action(async (
|
|
107
|
-
await
|
|
111
|
+
.action(async () => {
|
|
112
|
+
const deployTag = await getDeployTag();
|
|
113
|
+
const { env, site } = await getDefaultDeploySite(deployTag);
|
|
114
|
+
await deployTemplate(env, site, deployTag);
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
program
|
|
118
|
+
.command('deployTemplate')
|
|
119
|
+
.description('Deploy an application for a specific site')
|
|
120
|
+
.action(async () => {
|
|
121
|
+
const deployTag = await getDeployTag();
|
|
122
|
+
const { env, site } = await getDefaultDeploySite(deployTag);
|
|
123
|
+
await deployTemplate(env, site, deployTag);
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
program
|
|
127
|
+
.command('deploy-app <application>')
|
|
128
|
+
.description('Deploy an application for a specific site')
|
|
129
|
+
.action(async (application) => {
|
|
130
|
+
const deployTag = await getDeployTag();
|
|
131
|
+
const { env, site } = await getDefaultDeploySite(deployTag);
|
|
132
|
+
await deployAppWithTag(application, env, site, deployTag);
|
|
108
133
|
});
|
|
109
134
|
|
|
110
135
|
program
|
package/src/next/deploy.js
CHANGED
|
@@ -266,7 +266,7 @@ export async function writeAndPushDeployConfig(
|
|
|
266
266
|
* @param {string} site - The site name.
|
|
267
267
|
*/
|
|
268
268
|
|
|
269
|
-
async function getDeployTag() {
|
|
269
|
+
export async function getDeployTag() {
|
|
270
270
|
const gitTag = (
|
|
271
271
|
await $`git tag --points-at HEAD | grep '^v' | head -n 1`
|
|
272
272
|
).stdout.trim();
|
|
@@ -274,12 +274,17 @@ async function getDeployTag() {
|
|
|
274
274
|
return deployTag;
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
-
export async function
|
|
278
|
-
const
|
|
277
|
+
export async function getDefaultDeploySite(deployTag) {
|
|
278
|
+
const env = deployTag.includes('alpha') ? 'dev' : 'qa';
|
|
279
|
+
const site = env === 'dev' ? 'financialdev' : 'qa';
|
|
280
|
+
return { env, site };
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export async function deployTemplate(env, site, deployTag) {
|
|
279
284
|
console.log(`Deploying standard template for site: ${site}`);
|
|
280
285
|
console.log(`Using deployment tag: ${deployTag}`);
|
|
281
286
|
const { repoPath, deployConfigFilePath, deployConfig } =
|
|
282
|
-
await cloneAndReadDeployConfig('graphql-server',
|
|
287
|
+
await cloneAndReadDeployConfig('graphql-server', env, site);
|
|
283
288
|
|
|
284
289
|
deployConfig.graphqlServer.standardConfigRemoteBranch = deployTag;
|
|
285
290
|
|
|
@@ -292,14 +297,17 @@ export async function deployTemplate(site) {
|
|
|
292
297
|
console.log('Deployment completed successfully.');
|
|
293
298
|
}
|
|
294
299
|
|
|
295
|
-
export async function
|
|
296
|
-
const deployTag = getDeployTag();
|
|
297
|
-
|
|
300
|
+
export async function deployAppWithTag(application, env, site, deployTag) {
|
|
298
301
|
console.log(`Deploying application: ${application} for site: ${site}`);
|
|
299
302
|
console.log(`Using deployment tag: ${deployTag}`);
|
|
300
303
|
|
|
304
|
+
if (env !== 'dev') {
|
|
305
|
+
const appDetails = appInfo[application];
|
|
306
|
+
await copy2(appDetails.repositoryName, 'dev', env, deployTag);
|
|
307
|
+
}
|
|
308
|
+
|
|
301
309
|
const { repoPath, deployConfigFilePath, deployConfig } =
|
|
302
|
-
await cloneAndReadDeployConfig(application,
|
|
310
|
+
await cloneAndReadDeployConfig(application, env, site);
|
|
303
311
|
const updatedConfigData = setTag(deployConfig, deployTag);
|
|
304
312
|
await writeAndPushDeployConfig(
|
|
305
313
|
repoPath,
|