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

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

  1. healthcheck.sh URL...: check each URL with a timeout, print status and latency, and exit non-zero if any fail

  2. clean-logs.sh DIR DAYS: compress logs older than one day and delete archives older than DAYS, with a dry-run flag

  3. disk-alert.sh THRESHOLD: report filesystems above a usage threshold and the five largest directories on each

  4. deploy.sh VERSION: pull a container image, restart the service, run the health check and roll back automatically if it fails

  5. Test each with Bats, including failure cases, and run ShellCheck and the tests in GitHub Actions

Deliverables

  • Repository with bin/, test/, .github/workflows/ and README.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

CriterionWeightWhat good looks like
Scripts handle bad input, spaces in paths and failures safely30%
Tests cover success, failure and edge cases30%
CI runs ShellCheck and tests and blocks merges on failure25%
README examples work exactly as written15%