Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions .github/workflows/hugo-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Build Hugo Preview

on:
push:
branches-ignore:
- main
paths:
- ".github/workflows/pages.yml"
- ".github/workflows/hugo-preview.yml"
- "hugo-docs/**"
- "feature-announcements/**"
pull_request:
branches:
- main
paths:
- ".github/workflows/pages.yml"
- ".github/workflows/hugo-preview.yml"
- "hugo-docs/**"
- "feature-announcements/**"
workflow_dispatch:

permissions:
contents: read

concurrency:
group: "hugo-preview-${{ github.ref }}"
cancel-in-progress: true

defaults:
run:
shell: bash

jobs:
build-preview:
runs-on: ubuntu-latest
env:
HUGO_VERSION: "0.158.0"
PREVIEW_BASEURL: "http://127.0.0.1:1313/"
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.22"

- name: Install Hugo CLI
run: |
wget -O "${{ runner.temp }}/hugo.deb" \
"https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb"
sudo dpkg -i "${{ runner.temp }}/hugo.deb"

- name: Download Hugo modules
working-directory: ./hugo-docs
run: hugo mod tidy

- name: Build Hugo preview site
working-directory: ./hugo-docs
env:
HUGO_ENVIRONMENT: production
HUGO_BASEURL: ${{ env.PREVIEW_BASEURL }}
run: hugo --gc --minify

- name: Upload Hugo preview artifact
uses: actions/upload-artifact@v4
with:
name: hugo-preview-${{ github.run_number }}
path: ./hugo-docs/public
if-no-files-found: error
retention-days: 7

- name: Publish preview instructions
run: |
{
echo "## Hugo branch preview"
echo
echo "Artifact: \`hugo-preview-${{ github.run_number }}\`"
echo
echo "After downloading the artifact, serve the extracted \`public/\` directory locally:"
echo
echo "\`\`\`bash"
echo "python -m http.server 1313 -d public"
echo "\`\`\`"
echo
echo "Then verify:"
echo
echo "- http://127.0.0.1:1313/docs/talks/chennai-foss-2026/"
echo "- http://127.0.0.1:1313/feature-announcements/chennai-foss-2026/idp-onboarding-demo.html"
echo
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."
} >> "$GITHUB_STEP_SUMMARY"
2 changes: 1 addition & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: "0.147.0"
HUGO_VERSION: "0.158.0"
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ Please be respectful and constructive in all interactions. We are committed to p
```bash
python -m pytest cli/test_cli.py mcp_server/test_server.py tests/test_comprehensive.py -v
```
4. If your change touches the Hugo docs or the Chennai FOSS demo pages, preview them from your branch before opening a PR:
```bash
cd /home/runner/work/devops_os/devops_os/hugo-docs
hugo mod tidy
hugo server --bind 0.0.0.0 --baseURL http://localhost:1313/
```
Verify:
- `http://localhost:1313/docs/talks/chennai-foss-2026/`
- `http://localhost:1313/feature-announcements/chennai-foss-2026/idp-onboarding-demo.html`
You can also run the **Build Hugo Preview** workflow to get a downloadable preview artifact without deploying to the production Pages site.

---

Expand Down
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,37 @@ You can also customize `.devcontainer/devcontainer.env.json` directly to enable

---

## 🌐 Hugo branch preview

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.

### Local preview

```bash
cd /home/runner/work/devops_os/devops_os/hugo-docs
hugo mod tidy
hugo server --bind 0.0.0.0 --baseURL http://localhost:1313/
```

Then verify:

- `http://localhost:1313/docs/talks/chennai-foss-2026/`
- `http://localhost:1313/feature-announcements/chennai-foss-2026/idp-onboarding-demo.html`

### GitHub Actions preview artifact

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.

After downloading the artifact, serve it locally:

```bash
python -m http.server 1313 -d public
```

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.

---

## 🤝 Contributing

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.
Expand Down
44 changes: 44 additions & 0 deletions cli/devopsos.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import cli.scaffold_devcontainer as scaffold_devcontainer
import cli.scaffold_unittest as scaffold_unittest
import cli.process_first as process_first
import cli.onboard as onboard
from cli import __version__

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


@app.command("onboard")
def onboard_cmd(
repo: str = typer.Option(".", "--repo", help="Local git repository path to analyze"),
repo_url: str = typer.Option("", "--repo-url", help="Optional repository URL shown in the dashboard"),
name: str = typer.Option("demo-app", "--name", help="Application name used in generated assets"),
output_dir: str = typer.Option("", "--output-dir", help="Output directory for generated assets (defaults to repo path)"),
enable_ci: bool = typer.Option(True, "--enable-ci/--disable-ci", help="Generate GitHub Actions CI assets"),
enable_unittest: bool = typer.Option(True, "--enable-unittest/--disable-unittest", help="Generate unit test scaffold assets"),
enable_container: bool = typer.Option(True, "--enable-container/--disable-container", help="Generate container/devcontainer assets"),
enable_cd: bool = typer.Option(False, "--enable-cd/--disable-cd", help="Generate ArgoCD GitOps assets"),
enable_sre: bool = typer.Option(False, "--enable-sre/--disable-sre", help="Generate SRE/monitoring assets"),
):
"""Analyze a repo and scaffold a lightweight IDP onboarding POC."""
flags = [
"--repo", repo,
"--repo-url", repo_url,
"--name", name,
"--output-dir", output_dir,
]
if enable_ci:
flags.append("--enable-ci")
else:
flags.append("--disable-ci")
if enable_unittest:
flags.append("--enable-unittest")
else:
flags.append("--disable-unittest")
if enable_container:
flags.append("--enable-container")
else:
flags.append("--disable-container")
if enable_cd:
flags.append("--enable-cd")
else:
flags.append("--disable-cd")
if enable_sre:
flags.append("--enable-sre")
else:
flags.append("--disable-sre")
_run_scaffold(onboard.main, flags)


@app.command("process-first")
def process_first_cmd(
section: ProcessFirstSection = typer.Option(
Expand Down
Loading
Loading