|
17 | 17 | import cli.scaffold_devcontainer as scaffold_devcontainer |
18 | 18 | import cli.scaffold_unittest as scaffold_unittest |
19 | 19 | import cli.process_first as process_first |
| 20 | +import cli.onboard as onboard |
20 | 21 | from cli import __version__ |
21 | 22 |
|
22 | 23 | class ProcessFirstSection(str, enum.Enum): |
@@ -61,6 +62,7 @@ def main( |
61 | 62 | python -m cli.devopsos scaffold sre --help # SRE resources (SLOs, alerts, dashboards) |
62 | 63 | python -m cli.devopsos scaffold devcontainer --help # dev container configuration |
63 | 64 | python -m cli.devopsos scaffold cicd --help # combined CI/CD scaffold |
| 65 | + python -m cli.devopsos onboard --repo . # onboarding POC for a local repo |
64 | 66 | python -m cli.devopsos process-first # Process-First SDLC overview |
65 | 67 | python -m cli.devopsos --version # show installed version |
66 | 68 | """ |
@@ -843,6 +845,48 @@ def _sel(group): return selected_by_group.get(group, []) |
843 | 845 | typer.echo("Dockerfile uses build args; ensure it references the correct ARGs.") |
844 | 846 |
|
845 | 847 |
|
| 848 | +@app.command("onboard") |
| 849 | +def onboard_cmd( |
| 850 | + repo: str = typer.Option(".", "--repo", help="Local git repository path to analyze"), |
| 851 | + repo_url: str = typer.Option("", "--repo-url", help="Optional repository URL shown in the dashboard"), |
| 852 | + name: str = typer.Option("demo-app", "--name", help="Application name used in generated assets"), |
| 853 | + output_dir: str = typer.Option("", "--output-dir", help="Output directory for generated assets (defaults to repo path)"), |
| 854 | + enable_ci: bool = typer.Option(True, "--enable-ci/--disable-ci", help="Generate GitHub Actions CI assets"), |
| 855 | + enable_unittest: bool = typer.Option(True, "--enable-unittest/--disable-unittest", help="Generate unit test scaffold assets"), |
| 856 | + enable_container: bool = typer.Option(True, "--enable-container/--disable-container", help="Generate container/devcontainer assets"), |
| 857 | + enable_cd: bool = typer.Option(False, "--enable-cd/--disable-cd", help="Generate ArgoCD GitOps assets"), |
| 858 | + enable_sre: bool = typer.Option(False, "--enable-sre/--disable-sre", help="Generate SRE/monitoring assets"), |
| 859 | +): |
| 860 | + """Analyze a repo and scaffold a lightweight IDP onboarding POC.""" |
| 861 | + flags = [ |
| 862 | + "--repo", repo, |
| 863 | + "--repo-url", repo_url, |
| 864 | + "--name", name, |
| 865 | + "--output-dir", output_dir, |
| 866 | + ] |
| 867 | + if enable_ci: |
| 868 | + flags.append("--enable-ci") |
| 869 | + else: |
| 870 | + flags.append("--disable-ci") |
| 871 | + if enable_unittest: |
| 872 | + flags.append("--enable-unittest") |
| 873 | + else: |
| 874 | + flags.append("--disable-unittest") |
| 875 | + if enable_container: |
| 876 | + flags.append("--enable-container") |
| 877 | + else: |
| 878 | + flags.append("--disable-container") |
| 879 | + if enable_cd: |
| 880 | + flags.append("--enable-cd") |
| 881 | + else: |
| 882 | + flags.append("--disable-cd") |
| 883 | + if enable_sre: |
| 884 | + flags.append("--enable-sre") |
| 885 | + else: |
| 886 | + flags.append("--disable-sre") |
| 887 | + _run_scaffold(onboard.main, flags) |
| 888 | + |
| 889 | + |
846 | 890 | @app.command("process-first") |
847 | 891 | def process_first_cmd( |
848 | 892 | section: ProcessFirstSection = typer.Option( |
|
0 commit comments