Spec a Bash deploy script that can roll back
Your task
Your app runs on a single Linux server as a systemd service called shopd. Deploys are done by hand today. You want an agent to write the Bash script that does them: download the new build, keep the current release, swap in the new one and restart the service.
Write the spec you would hand the agent.
What you know:
- releases live in
/opt/shopd/releases/<version>, and/opt/shopd/currentis a symlink to the live one - builds are tarballs at
https://builds.internal/shopd/<version>.tar.gz, each with a.sha256file next to it - the service answers
GET http://localhost:8080/healthzwith 200 once it is ready - the script runs as a user that may restart
shopdwith sudo
Then, in a few sentences: what does a quick "write a deploy script" prompt get wrong?