#!/usr/bin/env bash # ---------------------------------------------------------- # Safe-default lab script · Shoolini × L&T EduTech # Run inside a container or throwaway VM, never on prod. # ---------------------------------------------------------- set -Eeuo pipefail shopt -s inherit_errexit nullglob umask 077 IFS=$'\n\t' readonly SCRIPT_NAME="${0##*/}" readonly WORK_DIR="$(mktemp -d -t lab.XXXXXX)" log() { printf '[%s] %s\n' "$(date -u +%FT%TZ)" "$*"; } die() { log "FATAL: $*"; exit 1; } need() { command -v "$1" >/dev/null || die "missing tool: $1"; } cleanup() { local rc=$? rm -rf -- "$WORK_DIR" log "$SCRIPT_NAME exited rc=$rc" exit "$rc" } trap cleanup EXIT trap 'die "interrupted"' INT TERM # preflight · fail loudly, fail early need docker; need kubectl; need shellcheck # your lab here · idempotent, isolated, scoped to $WORK_DIR log "workspace=$WORK_DIR"
Work / Cloud · Infra / DevOps Shell Scripts
DEVOPS-SHELL-SCRIPTS(1) Training Handbook Shoolini · L&T EduTech
devops-shell-scripts A handbook for the bash that survives the first day on the job.
Most training scripts work in the trainer's lab and break in the student's first job. They run with no error trapping, swallow undefined variables, hide failed pipes, and copy-paste straight into a prod incident. This handbook teaches the opposite. Industry-pattern bash from line one. Lint in CI. MIT-licensed. Run it in a container or a throwaway VM, never in production.
Act I · The Problem
The training script worked. The first job did not.
Most DevOps tutorials teach the happy path with unsafe defaults. The script runs once, the screen says "ok", the student learns the wrong habit. Then the same student lands at a real company, runs the same pattern against a real cluster, and an undefined variable expands to rm -rf / in front of the senior on call.
-
Pain · 01
No
set -e. Noset -u. Nopipefail.The script keeps running after a failed step. The exit code lies. The pipeline reports green. The pod is broken. The on-call learns the habit was never installed in the first place.
-
Pain · 02
"It works on my machine" is the curriculum.
The lab assumes the trainer's laptop. No container. No version pin. No idempotency. Re-running the script the second time blows up because the first run already created the resource. Real teams demand reruns.
-
Pain · 03
Security is an afterthought, not a gate.
SCA, SAST, secret scanning, container scanning, IaC policy, SBOMs. None of it is in the lab, none of it is in CI. The student ships a CV that says "DevOps" and walks into a DevSecOps interview unarmed.
-
Pain · 04
The repo is one giant script, not ten small labs.
You cannot study what you cannot isolate. A handbook needs a table of contents. Each lab needs to fail safely on its own. Each lab needs to lint, run, and clean up without taking the laptop with it.
Act II · The Promise
Safe defaults on line one. Every script. Every lab.
Bash has the discipline. Most curricula skip teaching it. This handbook puts the strict flags, the trap, the umask and the temp-dir cleanup at the top of every script. The student copies the pattern into the first job and never has to unlearn it.
Act III · The Curriculum
Ten labs. Each one ends with a habit the first job will reward.
Every lab lives in its own directory. Every lab is small enough to run on a 4 GB Linux VM or a Docker-in-Docker sandbox. Every lab finishes with a checklist the student walks into the office knowing.
- Lab 01
- Lab 02
- Lab 03
- Lab 04
- Lab 05
- Lab 06
- Lab 07
- Lab 08
- Lab 09
- Lab 10
Act IV · The Field Map
Twenty tools, two professions. Recognise them all on day one.
A junior engineer who can name and place these on a whiteboard is already an asset to the team. The handbook frames every lab against this map so the student leaves knowing where each tool sits in a real release.
- 01Source control and PR flowGitHub · GitLab · Bitbucket
- 02CI/CD pipelinesGitHub Actions · Jenkins · GitLab CI · Azure DevOps · CircleCI
- 03ContainersDocker · Podman
- 04Orchestration platformKubernetes · Helm · Kustomize · Argo CD · Flux
- 05Infrastructure as codeTerraform · OpenTofu · CloudFormation · Pulumi
- 06Config and releaseAnsible · Helm · Packer
- 07ObservabilityPrometheus · Grafana · Datadog · New Relic · Splunk
- 08Centralised loggingElastic Stack · Loki · CloudWatch · Cloud Logging
- 09Artifact and image registriesArtifactory · Nexus · Harbor · ECR · GCR · ACR
- 10Tracking and ChatOpsJira · GitHub Issues · Slack · Microsoft Teams
- 01SCA and dependency updatesDependabot · Snyk · OWASP Dependency-Check · Renovate
- 02Secret hygieneGitHub Secret Scanning · Gitleaks · TruffleHog
- 03SAST in CISonarQube · Semgrep · Checkmarx · Veracode · GitLab SAST
- 04DASTOWASP ZAP · Burp Suite · StackHawk
- 05Image and artifact scanningTrivy · Grype · Anchore · Clair · Syft
- 06IaC and K8s policyCheckov · tfsec · Terrascan · OPA · Conftest · Kyverno
- 07Secrets managementHashiCorp Vault · External Secrets Operator · cloud KMS
- 08Supply chain integritySyft · CycloneDX · SPDX · Sigstore cosign
- 09Runtime threat detectionFalco · CNAPP · CSPM · Wiz · Prisma · Defender
- 10Vulnerability and SIEM/SOARNessus · Qualys · Defender for Cloud · Splunk · Sentinel
Act V · Proof
A handbook that checks itself on every push.
CI · lint badge live
ShellCheck on every PR
GitHub Actions runs lint.yml on every push and pull request. The handbook holds itself to the same gate the labs preach to the students.
Audience · Shoolini × L&T EduTech
Hands-on training programme
Prepared by Divya Mohan under the guidance of Prashant Singh Gautam, L&T EduTech. The repository is the lab manual for the DevOps and Deployment programme at Shoolini University.
Licence · MIT
Learn in public, fork in public
Every script is MIT licensed. Every lab is reproducible. Discussions, issues and pull requests are open. Security findings go to SECURITY.md first, never to the public tracker.
Surface · 10 lab directories
Containers to SIEM
docker, k8s, jenkins, sonarcube, prometheus, grafana, springboot, zero-trust-mysql, autoscalling-loadbalancing-demo, plus the DevSecOps gate set. Each one isolated, each one rerunnable.
Safety · container or VM only
Never the trainer's laptop
Every lab is intended for an isolated environment. The repository's responsible-use note is the first thing the contributor reads. The pattern is the lesson.
Reach · students and early-career
From "what's a pod?" to "what's the SLO?"
Designed for the student writing their first Dockerfile and the developer moving toward SRE. Small labs, fast feedback, safer habits than the default tutorial.
The Toolbelt
Boring on purpose. Production-shaped from the first lab.
- Bash · set -Eeuo pipefail
- ShellCheck
- Docker · Compose
- Kubernetes
- kind · minikube
- Helm · Kustomize
- Jenkins
- GitHub Actions
- SonarQube
- Prometheus
- Grafana
- Spring Boot
- Trivy · Grype
- Checkov · tfsec
- Gitleaks · Semgrep
- Sigstore cosign
- OPA · Conftest · Kyverno
- MIT licence
If a training repo can ship like this, your team's runbook can too.
I write the handbooks the senior on call wishes the junior had read. If your team needs a curriculum, a hardened script template, or a CI lane that catches the bash mistakes the lab teaches by accident, the conversation starts here.