Turn a Hard-Coded Script Into a Real CLI
/home/student/deploy/deploy.py deploys a version to an environment, but both are hard-coded at the top of the file and people edit it before every run (and commit their edits by accident). Make it a proper command-line tool with argparse.
python3 deploy.py --env {dev,staging,prod} --version VERSION [--dry-run]
--env and --version are required; --env only accepts dev, staging or prod. A missing or invalid option prints a usage error and exits 2.--dry-run, print would deploy VERSION to ENV; without it, print deploying VERSION to ENV.--help prints a help page that describes --dry-run, and exits 0.About this machine
Ubuntu 24.04 with no internet access. You are student with passwordless sudo. The grader checks the final state of the machine, not the commands you typed. Values like names and ports are generated for you.
Teaching or writing about this? Embed this lab on your page
Your machine is ready to start
A fresh, isolated Ubuntu machine boots in a few seconds with the task already set up.
No account needed: 3 of 3 free tries left. Guest machines last 30 minutes.