Skip to content

About

A professional repo for mastering Bash scripting as a DevOps engineer. Includes structured lessons, examples, projects, and integrations for CI/CD, Kubernetes, ArgoCD, etc.

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

🐚 bash-mastery-devops

From core Bash to Principal-level DevOps automation — in 30 focused days

License: MIT Days Structure Gates


Every day is one focused lesson with runnable scripts and a BATS test suite — no filler, equal weight, identical structure. Shared logic lives once in /lib, and pre-commit + BATS gate the repo from Day 1.

🚀 Get started in 2 minutes

git clone <this repo> && cd bash-mastery-devops
pip install --user pre-commit && pre-commit install

bash days/day01/scripts/variables.sh   # run a lesson
bats days/day01/tests                  # test a lesson
bats -r days                           # test everything

.env is only needed for the Day 10 lesson (safe config loading). No other day — and no test/CI run — requires it. When you get to Day 10, run cp .env.example .env and fill in your values (.env is gitignored; never commit real secrets).

🗺️ The 30-day path

Six phases, five days each.

Phase Days Theme
1 01–05 🧱 Bash Foundations
2 06–10 📦 Data, Files & Text
3 11–15 🛡️ Robust & Concurrent Scripting
4 16–20 ✅ Quality, Security & Performance
5 21–25 ⚙️ DevOps Automation
6 26–30 🏛️ Platform Engineering (Principal)

📚 Daily lessons

Each day links straight to its lesson. Open any day to get the walkthrough, runnable scripts, and its test suite.

🧱 Phase 1 — Bash Foundations

Day Topic Lesson
01 Shell basics & variables — shebang, strict mode, readonly, export open »
02 Conditionals & test expressions — if/elif, [[ ]], regex validation open »
03 Loops — for / while / until and the safe read pattern open »
04 Functions & scope — local, echo-return, defaults, array returns open »
05 Arguments & getopts — positionals, $@, named flags with validation open »

📦 Phase 2 — Data, Files & Text

Day Topic Lesson
06 File I/O & redirection — >/>>/2>/&>, here-docs, safe reads open »
07 Text processing — grep / sed / awk + the cut|sort|uniq combo open »
08 Arrays & associative arrays — indexed maps, keys, mapfile open »
09 JSON & API integration — jq read/filter/build, curl patterns open »
10 Environment variables & config — safe .env loading, validation, masking open »

🛡️ Phase 3 — Robust & Concurrent Scripting

Day Topic Lesson
11 Error handling, logging & debugging — traps, shared logger, bash -x open »
12 Process management & signals — background jobs, PIDs, wait, traps open »
13 Parallel & concurrent execution — bounded worker pools, wait -n open »
14 Modular libraries — one shared /lib, sourcing, dual-use guard open »
15 Unit testing with BATS — run, lifecycle, failure paths open »

✅ Phase 4 — Quality, Security & Performance

Day Topic Lesson
16 Pre-commit hooks & linting — the quality gate, per-day runs open »
17 Security fundamentals — secret scanning, permission hardening, safe patterns open »
18 Zero-trust security pipeline — artifact verification, signed stages, deploy guard open »
19 Performance optimization — benchmarking, profiling, hot-path tuning open »
20 Unix tooling at scale — field extraction, histograms, streaming pipelines open »

⚙️ Phase 5 — DevOps Automation

Day Topic Lesson
21 Capstone I — Distributed Log Analyzer Pro — parse, aggregate & report web logs open »
22 Rootless containers — Buildah/Podman/Cosign, rootless runs, image audit open »
23 Modular CI/CD framework — staged pipelines, fail-fast, timing open »
24 Git-driven auto-deploy (GitOps) — reconcile, drift detection, prune open »
25 Kubernetes automation with kubectl — safe apply, context guard, protected contexts open »

🏛️ Phase 6 — Platform Engineering (Principal)

Day Topic Lesson
26 Kubernetes Operators & CRDs — reconcile loop, status subresource, self-heal open »
27 ArgoCD App-of-Apps — leaf & root apps, honest sync status, drift gate open »
28 Chaos Engineering — steady-state checks, blast radius, reproducible experiments open »
29 Self-Healing systems — liveness probes, restart policy, CrashLoopBackOff open »
30 Cost & FinOps — spend report, waste/risk detection, right-sizing gate open »

Full curriculum index: docs/curriculum.md

🏗️ Capstone project — devops-platform

The graduation project ties the platform days together into one real, end-to-end system: a GitOps-managed, self-healing, cost-observable platform on Kubernetes — operated entirely with the scripts you built. Every one of Days 22–30 maps to a real command (up · deploy · operate · chaos · heal · cost), and an offline validate keeps it CI-green with no cluster.

bash projects/devops-platform/capstone.sh validate            # offline sanity check
bash projects/devops-platform/capstone.sh up --context kind-bash-mastery

Full guide: projects/devops-platform/README.md

🗂️ Repository layout

bash-mastery-devops/
├── lib/            shared libraries (logging, retry, lock, validator, utils)
├── tests/          shared BATS helper
├── days/dayNN/     one self-contained lesson each (README.md + scripts/ + tests/)
├── projects/       capstone projects (Phase 5+)
├── platform/       Kubernetes / ArgoCD / policies / monitoring (Phase 6)
├── docs/           curriculum.md index + reference notes
└── .github/        CI · Security · Release workflows

🔒 Quality gates (active from Day 1)

  • pre-commit — shfmt + shellcheck + gitleaks + hygiene hooks. Run per day on only that day's files: pre-commit run --files days/dayNN/scripts/*.sh days/dayNN/tests/*.bats or across the whole repo with pre-commit run --all-files.
  • BATS — every day has a suite; bats -r days runs them all.
  • CI — .github/workflows/ runs lint + tests + security on every push.

🤝 Contributing

See CONTRIBUTING.md for the "day contract" every folder follows.

MIT licensed · one concept per day · test everything

About

A professional repo for mastering Bash scripting as a DevOps engineer. Includes structured lessons, examples, projects, and integrations for CI/CD, Kubernetes, ArgoCD, etc.

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages