From ddbc400acd085078d80ca67de3bbcc702e280458 Mon Sep 17 00:00:00 2001 From: howlcipher Date: Thu, 13 Aug 2026 16:22:38 -0400 Subject: [PATCH] feat(core): beta hardening and packaging --- .github/workflows/ci.yml | 10 ++- docs/getting-started.md | 83 +++++++++++++++++++++++++ docs/index.html | 22 ++++--- src/devops_learn/cli/commands/config.py | 25 ++++++++ src/devops_learn/cli/commands/report.py | 2 +- src/devops_learn/cli/main.py | 2 + 6 files changed, 132 insertions(+), 12 deletions(-) create mode 100644 docs/getting-started.md create mode 100644 src/devops_learn/cli/commands/config.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a2423a5..4ba765d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,6 +92,12 @@ jobs: test-venv/bin/pip install dist/*.whl - name: Smoke test CLI run: | - test-venv/bin/devops-learn doctor - test-venv/bin/devops-learn explain "Terraform state" + # Test outside the repository to ensure no accidental source dependencies + cd /tmp + $GITHUB_WORKSPACE/test-venv/bin/devops-learn + $GITHUB_WORKSPACE/test-venv/bin/devops-learn --help + $GITHUB_WORKSPACE/test-venv/bin/devops-learn doctor + $GITHUB_WORKSPACE/test-venv/bin/devops-learn report --help + $GITHUB_WORKSPACE/test-venv/bin/devops-learn ai-test --help + $GITHUB_WORKSPACE/test-venv/bin/devops-learn explain "Terraform state" diff --git a/docs/getting-started.md b/docs/getting-started.md new file mode 100644 index 0000000..167001a --- /dev/null +++ b/docs/getting-started.md @@ -0,0 +1,83 @@ +# Getting Started with DevOps Learn + +`devops-learn` is an AI-assisted DevOps learning CLI that guides you through a security-gated Azure deployment lifecycle using real engineering tools. + +## Installation + +You can install `devops-learn` in an isolated virtual environment from the wheel, or in development mode. + +### Production Install (from wheel) +```bash +python -m venv venv +source venv/bin/activate +pip install devops_learn-0.2.0-py3-none-any.whl +``` + +### Development Install (from source) +```bash +git clone https://github.com/howlcipher/DevOps-Learn-by-Doing.git +cd DevOps-Learn-by-Doing +python -m venv .venv +source .venv/bin/activate +pip install -e ".[dev]" +``` + +## The Workflow + +The core philosophy of `devops-learn` is to move from simulation to real execution in controlled steps. +The recommended progression is: + +### 1. Check Readiness +Start by checking your system capabilities: +```bash +devops-learn doctor +``` +Install any missing prerequisites (Docker, Terraform, Azure CLI, Trivy, Conftest) according to the output. + +### 2. Set Up Learner Profile (Optional) +Configure your experience level to customize AI explanations: +```bash +devops-learn profile --set docker=strong terraform=beginner +``` + +### 3. Understand Your Workload +Initialize the project context and get AI-assisted architecture recommendations: +```bash +devops-learn init . +``` + +### 4. Build Locally +Run the real local vertical slice (pytest, flake8, and local Docker build): +```bash +devops-learn local . +``` + +### 5. Secure +Scan your code and configurations with Trivy and Conftest: +```bash +devops-learn security scan . +``` + +### 6. Infrastructure as Code +Plan your Terraform configuration safely: +```bash +devops-learn terraform . +``` + +### 7. Deploy to Azure +Execute the real, approval-controlled Container Apps path: +```bash +devops-learn deploy . +``` +*Note: Azure deployment remains IMPLEMENTED but AWAITING LIVE VERIFICATION until an actual acceptance run provides proof.* + +### 8. Prove Your Work +Generate an engineering evidence report from your session: +```bash +devops-learn report +``` + +You can view your active configuration anytime using: +```bash +devops-learn config show +``` diff --git a/docs/index.html b/docs/index.html index b04f04c..6041ccf 100644 --- a/docs/index.html +++ b/docs/index.html @@ -682,19 +682,23 @@

Azure lifecycle acceptance run

-

# install the project and development dependencies

-

pip install -e ".[dev]"

+

# 01 CHECK

+

devops-learn doctor


-

# set your learner profile

-

devops-learn profile --set docker=strong terraform=beginner

+

# 02 UNDERSTAND

+

devops-learn init .


-

# run a real local vertical slice

-

devops-learn local projects/api_platform

+

# 03 BUILD

+

devops-learn local .


-

# simulate the full cloud workflow

-

devops-learn analyze projects/api_platform --mode collaborative --depth learning

+

# 04 SECURE

+

devops-learn security scan .


-

Other commands: init · review · history · explain

+

# 05 DEPLOY

+

devops-learn deploy .

+
+

# 06 PROVE

+

devops-learn report

diff --git a/src/devops_learn/cli/commands/config.py b/src/devops_learn/cli/commands/config.py new file mode 100644 index 0000000..71e7b16 --- /dev/null +++ b/src/devops_learn/cli/commands/config.py @@ -0,0 +1,25 @@ +"""`devops-learn config`: display configuration settings.""" + +from __future__ import annotations + +import argparse + +from devops_learn.bootstrap import Platform +from devops_learn.config.settings import load_settings + + +def register(subparsers: "argparse._SubParsersAction[argparse.ArgumentParser]") -> None: + parser = subparsers.add_parser("config", help="Manage configuration") + subparsers_config = parser.add_subparsers(dest="config_command", required=True) + show_parser = subparsers_config.add_parser("show", help="Show current configuration") + show_parser.set_defaults(handler=run_show) + + +def run_show(args: argparse.Namespace, platform: Platform) -> None: + settings = load_settings() + has_key = bool(settings.anthropic_api_key) + + print("DEVOPS-LEARN CONFIGURATION") + print(f"{'Database path':<25} {settings.db_path}") + print(f"{'AI Provider':<25} {settings.ai_provider}") + print(f"{'Anthropic credential':<25} {'Configured' if has_key else 'Not configured'}") diff --git a/src/devops_learn/cli/commands/report.py b/src/devops_learn/cli/commands/report.py index 7c19e36..ba52a2a 100644 --- a/src/devops_learn/cli/commands/report.py +++ b/src/devops_learn/cli/commands/report.py @@ -32,7 +32,7 @@ def register(subparsers: "argparse._SubParsersAction[argparse.ArgumentParser]") def run(args: argparse.Namespace, platform: Platform) -> None: session = platform.session_service.latest() if not session: - print("No sessions found.") + print("No engagement evidence recorded yet.\n\nStart with:\ndevops-learn init ") return assert session.id is not None diff --git a/src/devops_learn/cli/main.py b/src/devops_learn/cli/main.py index 893eff0..d308609 100644 --- a/src/devops_learn/cli/main.py +++ b/src/devops_learn/cli/main.py @@ -22,6 +22,7 @@ security, terraform, ai_test, + config, ) from devops_learn.config.settings import load_settings from devops_learn.domain.enums import ExecutionMode @@ -59,6 +60,7 @@ doctor, report, ai_test, + config, )