Skip to content

Latest commit

 

History

History
471 lines (374 loc) · 15.2 KB

File metadata and controls

471 lines (374 loc) · 15.2 KB

DevOps-OS Quick Start Guide

This guide provides the essential CLI commands for using all functionalities of the DevOps-OS development container project.

📖 Full reference: For the complete list of every option, input file, and output location see CLI-COMMANDS-REFERENCE.md.

Table of Contents

Setting Up DevOps-OS

Clone the DevOps-OS Repository

git clone https://github.com/cloudengine-labs/devops_os.git
cd devops_os

Set Up a Python Virtual Environment (Recommended)

A virtual environment isolates DevOps-OS dependencies from your system Python and avoids version conflicts with other projects.

# Create the virtual environment
python -m venv .venv

# Activate it — run this every time you open a new terminal
source .venv/bin/activate        # macOS / Linux
# .venv\Scripts\activate         # Windows (cmd)
# .venv\Scripts\Activate.ps1     # Windows (PowerShell)

# Install CLI dependencies
pip install -r cli/requirements.txt

You will see (.venv) in your prompt when the environment is active.
To deactivate it later, simply run deactivate.

Skip the venv only when running inside a Docker container or CI/CD runner where environment isolation is already provided.

Configure Development Container

# Generate dev container config via the unified CLI
# Output: .devcontainer/devcontainer.json
#         .devcontainer/devcontainer.env.json
python -m cli.devopsos scaffold devcontainer \
  --languages python,go \
  --cicd-tools docker,terraform,kubectl,helm \
  --kubernetes-tools k9s,flux

# Or edit configuration manually before building
vim .devcontainer/devcontainer.env.json

# Open in VS Code and reopen in container
code .
# Then use Command Palette (Cmd+Shift+P): "Remote-Containers: Reopen in Container"

Process-First Philosophy

CloudEngineLabs (cloudenginelabs.io) is a Process-First SDLC automation company. Before running any scaffold command, use the process-first CLI option to understand the philosophy behind DevOps-OS and how it drives every tool in this project.

# Full overview — ideology, tooling map, and beginner tips
python -m cli.devopsos process-first

# What is Process-First? (core principles)
python -m cli.devopsos process-first --section what

# How each principle maps to a DevOps-OS scaffold command
python -m cli.devopsos process-first --section mapping

# AI prompts and book recommendations for DevOps beginners
python -m cli.devopsos process-first --section tips

Where does process-first help?

When you are… Run
New to DevOps-OS process-first — understand why before how
Onboarding a team process-first --section mapping — show how each scaffold encodes a process
Learning DevOps from scratch process-first --section tips — get AI prompts to study CI/CD, GitOps, and SRE
Choosing which scaffold to run first process-first --section what — align on the 5 core principles first

Tip: Run process-first --section mapping alongside scaffold commands to see exactly which Process-First principle each generated artefact satisfies.

GitHub Actions Workflows

Generate GitHub Actions Workflows

# Basic complete CI/CD workflow
# Output: .github/workflows/devops-os-complete.yml
python -m cli.devopsos scaffold gha

# Build-only workflow
# Output: .github/workflows/devops-os-build.yml
python -m cli.devopsos scaffold gha --type build

# Complete CI/CD workflow for a named application
# Output: .github/workflows/my-app-complete.yml
python -m cli.devopsos scaffold gha --name my-app --type complete

# Workflow with Kubernetes deployment
# Output: .github/workflows/my-app-complete.yml
python -m cli.devopsos scaffold gha --name my-app --kubernetes --k8s-method kubectl

# Matrix build across multiple platforms
# Output: .github/workflows/devops-os-complete.yml
python -m cli.devopsos scaffold gha --matrix

# Reusable workflow
# Output: .github/workflows/devops-os-reusable.yml
python -m cli.devopsos scaffold gha --type reusable

# Specify languages to enable
# Output: .github/workflows/devops-os-complete.yml
python -m cli.devopsos scaffold gha --languages python,java,go

# Custom container image
python -m cli.devopsos scaffold gha --image ghcr.io/myorg/devops-os:latest

# Custom output location
# Output: my-workflows/devops-os-complete.yml
python -m cli.devopsos scaffold gha --output my-workflows

Use Environment Variables Instead

# Set environment variables
export DEVOPS_OS_GHA_NAME=my-app
export DEVOPS_OS_GHA_TYPE=complete
export DEVOPS_OS_GHA_LANGUAGES=python,javascript
export DEVOPS_OS_GHA_KUBERNETES=true
export DEVOPS_OS_GHA_K8S_METHOD=kustomize

# Run generator (will use environment variables)
# Output: .github/workflows/my-app-complete.yml
python -m cli.devopsos scaffold gha

GitLab CI Pipelines

Generate GitLab CI Pipelines

# Complete pipeline for a Python project
# Output: .gitlab-ci.yml
python -m cli.devopsos scaffold gitlab --name my-app --languages python --type complete

# Build + test for Java
# Output: .gitlab-ci.yml
python -m cli.devopsos scaffold gitlab --name java-api --languages java --type test

# Pipeline with Kubernetes deploy via ArgoCD
# Output: .gitlab-ci.yml
python -m cli.devopsos scaffold gitlab --name my-app --languages python,go \
       --kubernetes --k8s-method argocd

# Custom output path
# Output: ci/my-pipeline.yml
python -m cli.devopsos scaffold gitlab --name my-app --output ci/my-pipeline.yml

Use Environment Variables Instead

export DEVOPS_OS_GITLAB_NAME=my-app
export DEVOPS_OS_GITLAB_TYPE=complete
export DEVOPS_OS_GITLAB_LANGUAGES=python,javascript
export DEVOPS_OS_GITLAB_KUBERNETES=true
export DEVOPS_OS_GITLAB_K8S_METHOD=kustomize

# Output: .gitlab-ci.yml
python -m cli.devopsos scaffold gitlab

Jenkins Pipelines

Generate Jenkins Pipelines

# Basic complete CI/CD pipeline
# Output: Jenkinsfile
python -m cli.devopsos scaffold jenkins

# Build-only pipeline
# Output: Jenkinsfile
python -m cli.devopsos scaffold jenkins --type build

# Complete CI/CD pipeline for a named application
# Output: Jenkinsfile
python -m cli.devopsos scaffold jenkins --name my-app --type complete

# Pipeline with Kubernetes deployment
# Output: Jenkinsfile
python -m cli.devopsos scaffold jenkins --name my-app --kubernetes --k8s-method kubectl

# Parameterized pipeline
# Output: Jenkinsfile
python -m cli.devopsos scaffold jenkins --parameters

# Specify languages to enable
# Output: Jenkinsfile
python -m cli.devopsos scaffold jenkins --languages java,go

# Specify SCM type
python -m cli.devopsos scaffold jenkins --scm git

# Custom output location
# Output: pipelines/Jenkinsfile
python -m cli.devopsos scaffold jenkins --output pipelines/Jenkinsfile

Use Environment Variables Instead

export DEVOPS_OS_JENKINS_NAME=my-app
export DEVOPS_OS_JENKINS_TYPE=complete
export DEVOPS_OS_JENKINS_LANGUAGES=python,javascript
export DEVOPS_OS_JENKINS_KUBERNETES=true
export DEVOPS_OS_JENKINS_K8S_METHOD=kustomize
export DEVOPS_OS_JENKINS_PARAMETERS=true

# Output: Jenkinsfile
python -m cli.devopsos scaffold jenkins

GitOps / ArgoCD & Flux CD

Generate ArgoCD Configurations

# ArgoCD Application CR + AppProject CR
# Output: argocd/application.yaml
#         argocd/appproject.yaml
python -m cli.devopsos scaffold argocd --name my-app \
       --repo https://github.com/myorg/my-app.git \
       --namespace production

# ArgoCD with automated sync and canary rollout
# Output: argocd/application.yaml
#         argocd/appproject.yaml
#         argocd/rollout.yaml
python -m cli.devopsos scaffold argocd --name my-app \
       --repo https://github.com/myorg/my-app.git \
       --auto-sync --rollouts

# Custom output directory
# Output: gitops/argocd/application.yaml  (etc.)
python -m cli.devopsos scaffold argocd --name my-app \
       --repo https://github.com/myorg/my-app.git \
       --output-dir gitops

Generate Flux CD Configurations

# Flux GitRepository + Kustomization + Image Automation
# Output: flux/git-repository.yaml
#         flux/kustomization.yaml
#         flux/image-update-automation.yaml
python -m cli.devopsos scaffold argocd --name my-app --method flux \
       --repo https://github.com/myorg/my-app.git \
       --image ghcr.io/myorg/my-app

SRE Configuration

Generate SRE Configs

# All SRE configs
# Output: sre/alert-rules.yaml
#         sre/grafana-dashboard.json
#         sre/slo.yaml
#         sre/alertmanager-config.yaml
python -m cli.devopsos scaffold sre --name my-app --team platform

# Availability-only SLO
# Output: sre/alert-rules.yaml  (etc.)
python -m cli.devopsos scaffold sre --name my-app --slo-type availability --slo-target 99.9

# Latency SLO with 200ms threshold
python -m cli.devopsos scaffold sre --name my-app --slo-type latency --latency-threshold 0.2

# With PagerDuty integration
python -m cli.devopsos scaffold sre --name my-app \
       --pagerduty-key YOUR_PD_KEY \
       --slack-channel "#platform-alerts"

# Custom output directory
# Output: monitoring/alert-rules.yaml  (etc.)
python -m cli.devopsos scaffold sre --name my-app --output-dir monitoring

Container Configuration

Generate Dev Container Config via CLI

# Python + Go dev container
# Output: .devcontainer/devcontainer.json
#         .devcontainer/devcontainer.env.json
python -m cli.devopsos scaffold devcontainer \
  --languages python,go \
  --cicd-tools docker,kubectl,helm

# Full-stack container with Kubernetes tools
# Output: .devcontainer/devcontainer.json
#         .devcontainer/devcontainer.env.json
python -m cli.devopsos scaffold devcontainer \
  --languages python,java,javascript \
  --cicd-tools docker,terraform,kubectl,helm \
  --kubernetes-tools k9s,kustomize,argocd_cli,flux \
  --devops-tools prometheus,grafana \
  --python-version 3.12

# Write to a specific project directory
# Output: /path/to/myproject/.devcontainer/devcontainer.json
#         /path/to/myproject/.devcontainer/devcontainer.env.json
python -m cli.devopsos scaffold devcontainer \
  --languages python,go \
  --output-dir /path/to/myproject

# See all available options
python -m cli.devopsos scaffold devcontainer --help

Configure Development Container Manually

# Edit the devcontainer.env.json file
cat > .devcontainer/devcontainer.env.json << EOF
{
  "languages": {
    "python": true,
    "java": true,
    "javascript": true,
    "go": true
  },
  "cicd": {
    "docker": true,
    "terraform": true,
    "kubectl": true,
    "helm": true,
    "github_actions": true
  },
  "kubernetes": {
    "k9s": true,
    "kustomize": true,
    "argocd_cli": true,
    "flux": true
  },
  "versions": {
    "python": "3.11",
    "java": "17",
    "node": "20",
    "go": "1.21"
  }
}
EOF

Unit Test Scaffold

Generate ready-to-use unit test configuration files and sample test stubs for Python, JavaScript/TypeScript, and Go.

Python (pytest)

# Generate pytest.ini, conftest.py, and a sample test file
python -m cli.devopsos scaffold unittest --name my-api --languages python

# Without coverage configuration
python -m cli.devopsos scaffold unittest --name my-api --languages python --no-coverage

Output: pytest.ini, conftest.py, tests/__init__.py, tests/test_sample.py

JavaScript / TypeScript

# JavaScript with Jest (default)
python -m cli.devopsos scaffold unittest --name my-app --languages javascript --framework jest

# JavaScript with Mocha
python -m cli.devopsos scaffold unittest --name my-app --languages javascript --framework mocha

# TypeScript with Vitest
python -m cli.devopsos scaffold unittest --name my-app --languages typescript --framework vitest

Output (Jest): jest.config.js, tests/sample.test.js
Output (Vitest): vitest.config.js, tests/sample.test.ts
Output (Mocha): .mocharc.js, tests/sample.test.js

Go

# Generate a table-driven Go test file + Makefile
python -m cli.devopsos scaffold unittest --name my-service --languages go

Output: my_service_test.go, Makefile.test

Multi-stack (all three in one command)

python -m cli.devopsos scaffold unittest --name my-platform --languages python,javascript,go

All options

# Show all available options
python -m cli.devopsos scaffold unittest --help
Option Env var Default Description
--name NAME DEVOPS_OS_UNITTEST_NAME my-app Project name
--languages LANGS DEVOPS_OS_UNITTEST_LANGUAGES python Comma-separated: python, javascript, typescript, go
--framework FW DEVOPS_OS_UNITTEST_FRAMEWORK (auto) JS/TS override: jest | mocha | vitest
--coverage / --no-coverage DEVOPS_OS_UNITTEST_COVERAGE true Include or exclude coverage config
--output-dir DIR DEVOPS_OS_UNITTEST_OUTPUT_DIR . Root output directory

Common Options for All Generators

Option scaffold gha scaffold gitlab scaffold jenkins scaffold argocd scaffold sre scaffold devcontainer scaffold unittest Description
--name Name of the workflow/pipeline/app
--type Type of workflow/pipeline
--languages Languages to enable
--kubernetes Include K8s deployment steps
--k8s-method K8s deployment method
--output Output file path
--output-dir Output directory
--custom-values Custom configuration JSON file
--image Container image to use

Troubleshooting

# Show help for each generator
python -m cli.devopsos scaffold gha --help
python -m cli.devopsos scaffold gitlab --help
python -m cli.devopsos scaffold jenkins --help
python -m cli.devopsos scaffold argocd --help
python -m cli.devopsos scaffold sre --help
python -m cli.devopsos scaffold devcontainer --help
python -m cli.devopsos scaffold unittest --help

# Verify generated output locations
ls -la .github/workflows/      # GitHub Actions
cat .gitlab-ci.yml             # GitLab CI
cat Jenkinsfile                # Jenkins
ls -la argocd/                 # ArgoCD
ls -la flux/                   # Flux CD
ls -la sre/                    # SRE configs
ls -la .devcontainer/          # Dev container

# Verify dev container configuration
cat .devcontainer/devcontainer.env.json