@prism-d1/cli 1.0.54 ā 1.0.56
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/dist/assets/gitlab-workflows/prism-ai-metrics.yml +1 -1
- package/dist/assets/gitlab-workflows/prism-dora-weekly.yml +1 -1
- package/dist/src/commands/bootstrapper/install-github-workflows.d.ts +14 -0
- package/dist/src/commands/bootstrapper/install-github-workflows.d.ts.map +1 -0
- package/dist/src/commands/bootstrapper/install-github-workflows.js +34 -0
- package/dist/src/commands/bootstrapper/install-github-workflows.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
description: string;
|
|
3
|
+
options: {
|
|
4
|
+
flags: string;
|
|
5
|
+
description: string;
|
|
6
|
+
default: string;
|
|
7
|
+
}[];
|
|
8
|
+
action(opts: {
|
|
9
|
+
region?: string;
|
|
10
|
+
outputDir: string;
|
|
11
|
+
}): Promise<void>;
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
14
|
+
//# sourceMappingURL=install-github-workflows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-github-workflows.d.ts","sourceRoot":"","sources":["../../../../src/commands/bootstrapper/install-github-workflows.ts"],"names":[],"mappings":";;;;;;;iBAUqB;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE;;AAN3D,wBAkCE"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { mkdirSync, readFileSync, writeFileSync, readdirSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { getAssetPath } from '../../utils/root.js';
|
|
4
|
+
export default {
|
|
5
|
+
description: 'Install GitHub Actions workflow templates into the current repo',
|
|
6
|
+
options: [
|
|
7
|
+
{ flags: '--region <region>', description: 'AWS region for EventBridge/CloudWatch', default: 'us-west-2' },
|
|
8
|
+
{ flags: '--output-dir <dir>', description: 'Output directory', default: '.github/workflows' },
|
|
9
|
+
],
|
|
10
|
+
async action(opts) {
|
|
11
|
+
const region = opts.region || 'us-west-2';
|
|
12
|
+
const outputDir = opts.outputDir;
|
|
13
|
+
console.log(`\nš¦ Installing GitHub Actions workflows`);
|
|
14
|
+
console.log(` Region: ${region}`);
|
|
15
|
+
console.log(` Output: ${outputDir}/\n`);
|
|
16
|
+
mkdirSync(outputDir, { recursive: true });
|
|
17
|
+
const assetDir = getAssetPath(import.meta.url, 'github-workflows/prism-ai-metrics.yml').replace('/prism-ai-metrics.yml', '');
|
|
18
|
+
const files = readdirSync(assetDir).filter(f => f.endsWith('.yml'));
|
|
19
|
+
for (const file of files) {
|
|
20
|
+
let content = readFileSync(join(assetDir, file), 'utf-8');
|
|
21
|
+
content = content.replace(/aws-region: us-west-2/g, `aws-region: ${region}`);
|
|
22
|
+
content = content.replace(/--region us-west-2/g, `--region ${region}`);
|
|
23
|
+
writeFileSync(join(outputDir, file), content);
|
|
24
|
+
console.log(` ā ${file}`);
|
|
25
|
+
}
|
|
26
|
+
console.log(`\nā
Installed ${files.length} workflow files to ${outputDir}/`);
|
|
27
|
+
console.log(`\nNext steps:`);
|
|
28
|
+
console.log(` 1. Run: prism-cli bootstrapper setup-github-oidc`);
|
|
29
|
+
console.log(` 2. Add repository secret PRISM_METRICS_ROLE_ARN in GitHub`);
|
|
30
|
+
console.log(` 3. Commit and push the workflow files`);
|
|
31
|
+
console.log('');
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=install-github-workflows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-github-workflows.js","sourceRoot":"","sources":["../../../../src/commands/bootstrapper/install-github-workflows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC9E,OAAO,EAAE,IAAI,EAAE,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