Skip to content

Commit de02499

Browse files
Copilotchefgs
andauthored
Add Chennai FOSS onboarding POC as a thin IDP layer over existing DevOps-OS scaffolders (#69)
* Add onboarding orchestration CLI and Chennai FOSS demo assets Agent-Logs-Url: https://github.com/cloudengine-labs/devops_os/sessions/ea0c7a95-2d9a-453e-aaa1-7b54e2e22c94 Co-authored-by: chefgs <7605658+chefgs@users.noreply.github.com> * Polish Chennai FOSS onboarding dashboard flow Agent-Logs-Url: https://github.com/cloudengine-labs/devops_os/sessions/ea0c7a95-2d9a-453e-aaa1-7b54e2e22c94 Co-authored-by: chefgs <7605658+chefgs@users.noreply.github.com> * Restore unrelated Go module metadata Agent-Logs-Url: https://github.com/cloudengine-labs/devops_os/sessions/ea0c7a95-2d9a-453e-aaa1-7b54e2e22c94 Co-authored-by: chefgs <7605658+chefgs@users.noreply.github.com> * Plan Hugo branch preview support Agent-Logs-Url: https://github.com/cloudengine-labs/devops_os/sessions/da764e3f-6ccf-4173-87cc-3bff9ee56e38 Co-authored-by: chefgs <7605658+chefgs@users.noreply.github.com> * Add Hugo branch preview workflow Agent-Logs-Url: https://github.com/cloudengine-labs/devops_os/sessions/da764e3f-6ccf-4173-87cc-3bff9ee56e38 Co-authored-by: chefgs <7605658+chefgs@users.noreply.github.com> * Finalize Hugo branch preview support Agent-Logs-Url: https://github.com/cloudengine-labs/devops_os/sessions/da764e3f-6ccf-4173-87cc-3bff9ee56e38 Co-authored-by: chefgs <7605658+chefgs@users.noreply.github.com> * Restore module metadata after Hugo preview update Agent-Logs-Url: https://github.com/cloudengine-labs/devops_os/sessions/da764e3f-6ccf-4173-87cc-3bff9ee56e38 Co-authored-by: chefgs <7605658+chefgs@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: chefgs <7605658+chefgs@users.noreply.github.com>
1 parent de70cba commit de02499

28 files changed

Lines changed: 2427 additions & 4 deletions

File tree

.github/workflows/hugo-preview.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Build Hugo Preview
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- main
7+
paths:
8+
- ".github/workflows/pages.yml"
9+
- ".github/workflows/hugo-preview.yml"
10+
- "hugo-docs/**"
11+
- "feature-announcements/**"
12+
pull_request:
13+
branches:
14+
- main
15+
paths:
16+
- ".github/workflows/pages.yml"
17+
- ".github/workflows/hugo-preview.yml"
18+
- "hugo-docs/**"
19+
- "feature-announcements/**"
20+
workflow_dispatch:
21+
22+
permissions:
23+
contents: read
24+
25+
concurrency:
26+
group: "hugo-preview-${{ github.ref }}"
27+
cancel-in-progress: true
28+
29+
defaults:
30+
run:
31+
shell: bash
32+
33+
jobs:
34+
build-preview:
35+
runs-on: ubuntu-latest
36+
env:
37+
HUGO_VERSION: "0.158.0"
38+
PREVIEW_BASEURL: "http://127.0.0.1:1313/"
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v4
42+
with:
43+
fetch-depth: 0
44+
45+
- name: Setup Go
46+
uses: actions/setup-go@v5
47+
with:
48+
go-version: "1.22"
49+
50+
- name: Install Hugo CLI
51+
run: |
52+
wget -O "${{ runner.temp }}/hugo.deb" \
53+
"https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb"
54+
sudo dpkg -i "${{ runner.temp }}/hugo.deb"
55+
56+
- name: Download Hugo modules
57+
working-directory: ./hugo-docs
58+
run: hugo mod tidy
59+
60+
- name: Build Hugo preview site
61+
working-directory: ./hugo-docs
62+
env:
63+
HUGO_ENVIRONMENT: production
64+
HUGO_BASEURL: ${{ env.PREVIEW_BASEURL }}
65+
run: hugo --gc --minify
66+
67+
- name: Upload Hugo preview artifact
68+
uses: actions/upload-artifact@v4
69+
with:
70+
name: hugo-preview-${{ github.run_number }}
71+
path: ./hugo-docs/public
72+
if-no-files-found: error
73+
retention-days: 7
74+
75+
- name: Publish preview instructions
76+
run: |
77+
{
78+
echo "## Hugo branch preview"
79+
echo
80+
echo "Artifact: \`hugo-preview-${{ github.run_number }}\`"
81+
echo
82+
echo "After downloading the artifact, serve the extracted \`public/\` directory locally:"
83+
echo
84+
echo "\`\`\`bash"
85+
echo "python -m http.server 1313 -d public"
86+
echo "\`\`\`"
87+
echo
88+
echo "Then verify:"
89+
echo
90+
echo "- http://127.0.0.1:1313/docs/talks/chennai-foss-2026/"
91+
echo "- http://127.0.0.1:1313/feature-announcements/chennai-foss-2026/idp-onboarding-demo.html"
92+
echo
93+
echo "For a one-off hosted check, you can still run the production Pages workflow manually on this branch, but that deploys to the shared GitHub Pages environment."
94+
} >> "$GITHUB_STEP_SUMMARY"

.github/workflows/pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
build:
2525
runs-on: ubuntu-latest
2626
env:
27-
HUGO_VERSION: "0.147.0"
27+
HUGO_VERSION: "0.158.0"
2828
steps:
2929
- name: Checkout repository
3030
uses: actions/checkout@v4

CONTRIBUTING.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ Please be respectful and constructive in all interactions. We are committed to p
3232
```bash
3333
python -m pytest cli/test_cli.py mcp_server/test_server.py tests/test_comprehensive.py -v
3434
```
35+
4. If your change touches the Hugo docs or the Chennai FOSS demo pages, preview them from your branch before opening a PR:
36+
```bash
37+
cd /home/runner/work/devops_os/devops_os/hugo-docs
38+
hugo mod tidy
39+
hugo server --bind 0.0.0.0 --baseURL http://localhost:1313/
40+
```
41+
Verify:
42+
- `http://localhost:1313/docs/talks/chennai-foss-2026/`
43+
- `http://localhost:1313/feature-announcements/chennai-foss-2026/idp-onboarding-demo.html`
44+
You can also run the **Build Hugo Preview** workflow to get a downloadable preview artifact without deploying to the production Pages site.
3545

3646
---
3747

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,37 @@ You can also customize `.devcontainer/devcontainer.env.json` directly to enable
399399

400400
---
401401

402+
## 🌐 Hugo branch preview
403+
404+
The production GitHub Pages site is still deployed only from `main`, but you can test the Hugo-hosted Chennai FOSS IDP UI from your current branch in two safe ways.
405+
406+
### Local preview
407+
408+
```bash
409+
cd /home/runner/work/devops_os/devops_os/hugo-docs
410+
hugo mod tidy
411+
hugo server --bind 0.0.0.0 --baseURL http://localhost:1313/
412+
```
413+
414+
Then verify:
415+
416+
- `http://localhost:1313/docs/talks/chennai-foss-2026/`
417+
- `http://localhost:1313/feature-announcements/chennai-foss-2026/idp-onboarding-demo.html`
418+
419+
### GitHub Actions preview artifact
420+
421+
Use the **Build Hugo Preview** workflow on your branch. It builds the Hugo site without deploying to the shared GitHub Pages environment and uploads the generated `public/` directory as an artifact.
422+
423+
After downloading the artifact, serve it locally:
424+
425+
```bash
426+
python -m http.server 1313 -d public
427+
```
428+
429+
For a one-off hosted verification, you can still manually run **Deploy Hugo Documentation** on your branch with `workflow_dispatch`, but that updates the shared Pages site.
430+
431+
---
432+
402433
## 🤝 Contributing
403434

404435
Contributions are welcome! Whether it's a bug fix, a new scaffold generator, or documentation improvement — feel free to open an issue or submit a pull request.

cli/devopsos.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import cli.scaffold_devcontainer as scaffold_devcontainer
1818
import cli.scaffold_unittest as scaffold_unittest
1919
import cli.process_first as process_first
20+
import cli.onboard as onboard
2021
from cli import __version__
2122

2223
class ProcessFirstSection(str, enum.Enum):
@@ -61,6 +62,7 @@ def main(
6162
python -m cli.devopsos scaffold sre --help # SRE resources (SLOs, alerts, dashboards)
6263
python -m cli.devopsos scaffold devcontainer --help # dev container configuration
6364
python -m cli.devopsos scaffold cicd --help # combined CI/CD scaffold
65+
python -m cli.devopsos onboard --repo . # onboarding POC for a local repo
6466
python -m cli.devopsos process-first # Process-First SDLC overview
6567
python -m cli.devopsos --version # show installed version
6668
"""
@@ -843,6 +845,48 @@ def _sel(group): return selected_by_group.get(group, [])
843845
typer.echo("Dockerfile uses build args; ensure it references the correct ARGs.")
844846

845847

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+
846890
@app.command("process-first")
847891
def process_first_cmd(
848892
section: ProcessFirstSection = typer.Option(

0 commit comments

Comments
 (0)