Releases without fear
Put it together: ./release.sh 1.1.0 should check the version, build the image with it, replace the running container, prove the new version answers, and record it — or fail loudly without recording anything.
Validate before doing anything
A release script should refuse bad input before it changes anything. Check the version with a regular expression, check you're in the right folder, and check required tools exist. Every failure prints a clear message to stderr and exits non-zero, so a typo like 1.1 can never half-deploy.
version="${1:-}"
if ! [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "release: bad version: $version" >&2
exit 2
fi
[ -f Dockerfile ] || { echo "release: run from cafe/" >&2; exit 2; }