Capstone Automation Project
Checklist Gate
Stop on Failure
A release script should stop when a required check fails. This capstone example counts ready checks and records the first blocking step.
Program
Play the script to choose whether the release checklist passes or stops at tests.
release_checklist_gate.sh
#!/usr/bin/env bash
failed_step=
checks="lint tests build publish"
ready=0
for check in $checks; do
if [[ "$check" == "$failed_step" ]]; then
status="blocked:$check"
break
fi
ready=$((ready + 1))
done
if [[ "$failed_step" == "none" ]]; then
status="ready"
fi
echo "ready=$ready status=$status"
#!/usr/bin/env bash
failed_step=
checks="lint tests build publish"
ready=0
for check in $checks; do
if [[ "$check" == "$failed_step" ]]; then
status="blocked:$check"
break
fi
ready=$((ready + 1))
done
if [[ "$failed_step" == "none" ]]; then
status="ready"
fi
echo "ready=$ready status=$status"
checklist gate
A gate verifies required checks before a release proceeds.
fail fast
Failing fast records the first blocking step instead of hiding it.
release status
A final status line makes the release decision clear.