Project · Beginner · about 10 hours
An operations toolkit in Bash with tests
Write the small scripts an on-call engineer needs (health checks, log clean-up, disk alerts, a deploy helper), make them safe and test them in CI.
Skills:CI/CD, Git and GitHub, Linux and Bash
Part of: DevOps / Platform Engineer
Data and licences
- Open Food Facts product database ↗Open Database License (ODbL); images CC BY-SA
Brief
On-call engineers reach for the same few commands during every incident. Turn them into reliable, tested tools the whole team can use. The health check targets the Open Food Facts catalogue app from other projects, but any HTTP service works.
What to build
healthcheck.sh URL...: check each URL with a timeout, print status and latency, and exit non-zero if any failclean-logs.sh DIR DAYS: compress logs older than one day and delete archives older than DAYS, with a dry-run flagdisk-alert.sh THRESHOLD: report filesystems above a usage threshold and the five largest directories on eachdeploy.sh VERSION: pull a container image, restart the service, run the health check and roll back automatically if it failsTest each with Bats, including failure cases, and run ShellCheck and the tests in GitHub Actions
Deliverables
Repository with
bin/,test/,.github/workflows/andREADME.md
How it is graded
Reviewers run the tests, then try the scripts with bad arguments, paths with spaces and an unreachable URL.
Stretch
Package the scripts as a Debian package or a container image with a version number.
Deliverables
- Four scripts with usage messages, strict mode and meaningful exit codes
- Tests for each script with Bats or a shell test harness
- A CI workflow running ShellCheck and the tests on every push
- A README with examples
How a reviewer grades it
| Criterion | Weight | What good looks like |
|---|---|---|
| Scripts handle bad input, spaces in paths and failures safely | 30% | |
| Tests cover success, failure and edge cases | 30% | |
| CI runs ShellCheck and tests and blocks merges on failure | 25% | |
| README examples work exactly as written | 15% |