Skip to content

Commit 4989d30

Browse files
committed
feat: implement CI/CD command structure and containerization features with new migration and profiling capabilities
1 parent 56d5b58 commit 4989d30

69 files changed

Lines changed: 13287 additions & 9 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"@codecov/vite-plugin": "0.0.1-beta.9",
6767
"@commitlint/cli": "19.2.1",
6868
"@commitlint/config-conventional": "19.1.0",
69-
"@expressots/shared": "3.0.0",
69+
"@expressots/shared": "file:../shared/expressots-shared-4.0.0-beta.1.tgz",
7070
"@release-it/conventional-changelog": "7.0.2",
7171
"@types/chalk-animation": "1.6.1",
7272
"@types/cli-progress": "3.11.0",

src/cicd/cli.ts

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
import { Argv, CommandModule } from "yargs";
2+
import {
3+
initCICD,
4+
generateCICD,
5+
listPlatforms,
6+
validatePipelines
7+
} from "./form";
8+
9+
// eslint-disable-next-line @typescript-eslint/ban-types
10+
type CommandModuleArgs = {};
11+
12+
export type CIPlatform = "github" | "gitlab" | "circleci" | "jenkins" | "bitbucket" | "azure";
13+
export type CIStrategy = "basic" | "comprehensive" | "security-focused";
14+
15+
const cicdCommand = (): CommandModule<CommandModuleArgs, any> => {
16+
return {
17+
command: "cicd <action> [platform]",
18+
describe: "Generate and manage CI/CD pipeline configurations.",
19+
aliases: ["ci", "pipeline"],
20+
builder: (yargs: Argv): Argv => {
21+
yargs.positional("action", {
22+
choices: ["init", "generate", "list", "validate"] as const,
23+
describe: "Action to perform",
24+
type: "string",
25+
demandOption: true,
26+
});
27+
28+
yargs.positional("platform", {
29+
choices: ["github", "gitlab", "circleci", "jenkins", "bitbucket", "azure", "all"] as const,
30+
describe: "CI/CD platform to generate for",
31+
type: "string",
32+
});
33+
34+
yargs.option("strategy", {
35+
choices: ["basic", "comprehensive", "security-focused"] as const,
36+
describe: "CI/CD pipeline strategy",
37+
type: "string",
38+
alias: "s",
39+
default: "comprehensive",
40+
});
41+
42+
yargs.option("include-security", {
43+
describe: "Include security scanning (Trivy, Snyk)",
44+
type: "boolean",
45+
default: true,
46+
});
47+
48+
yargs.option("include-e2e", {
49+
describe: "Include end-to-end tests",
50+
type: "boolean",
51+
default: false,
52+
});
53+
54+
yargs.option("include-coverage", {
55+
describe: "Include code coverage reporting",
56+
type: "boolean",
57+
default: true,
58+
});
59+
60+
yargs.option("docker-registry", {
61+
describe: "Docker registry URL (e.g., ghcr.io, docker.io)",
62+
type: "string",
63+
alias: "r",
64+
});
65+
66+
yargs.option("deploy-target", {
67+
choices: ["kubernetes", "ecs", "cloudrun", "railway", "render", "fly", "none"] as const,
68+
describe: "Deployment target platform",
69+
type: "string",
70+
default: "none",
71+
});
72+
73+
yargs.option("branch", {
74+
describe: "Branch to trigger CI/CD on",
75+
type: "string",
76+
alias: "b",
77+
default: "main",
78+
});
79+
80+
yargs.option("node-version", {
81+
describe: "Node.js version for CI",
82+
type: "string",
83+
default: "20",
84+
});
85+
86+
yargs.option("output-dir", {
87+
describe: "Output directory for generated files",
88+
type: "string",
89+
alias: "o",
90+
});
91+
92+
return yargs;
93+
},
94+
handler: async (argv) => {
95+
const {
96+
action,
97+
platform,
98+
strategy,
99+
includeSecurity,
100+
includeE2e,
101+
includeCoverage,
102+
dockerRegistry,
103+
deployTarget,
104+
branch,
105+
nodeVersion,
106+
outputDir,
107+
} = argv;
108+
109+
const options = {
110+
platform: platform as CIPlatform | "all" | undefined,
111+
strategy: strategy as CIStrategy,
112+
includeSecurity,
113+
includeE2E: includeE2e,
114+
includeCoverage,
115+
dockerRegistry,
116+
deployTarget,
117+
branch,
118+
nodeVersion,
119+
outputDir,
120+
};
121+
122+
switch (action) {
123+
case "init":
124+
await initCICD(options);
125+
break;
126+
case "generate":
127+
await generateCICD(options);
128+
break;
129+
case "list":
130+
await listPlatforms();
131+
break;
132+
case "validate":
133+
await validatePipelines();
134+
break;
135+
default:
136+
console.log(`Unknown action: ${action}`);
137+
}
138+
},
139+
};
140+
};
141+
142+
export { cicdCommand };

0 commit comments

Comments
 (0)