CI and Deployment Helpers
CI Step Gate
Select a Check
CI helper scripts often choose a named check, build the command, and report a compact status line for the pipeline log.
Program
Play the script to choose the CI stage and see the modeled command and result.
ci_step_gate.sh
Replay: real traced execution (multi-file project)
#!/usr/bin/env bash
stage="test"
case "$stage" in
test) command="mvn test"; result="pass" ;;
lint) command="shellcheck scripts"; result="pass" ;;
esac
echo "$stage:$command:$result"
#!/usr/bin/env bash
stage="lint"
case "$stage" in
test) command="mvn test"; result="pass" ;;
lint) command="shellcheck scripts"; result="pass" ;;
esac
echo "$stage:$command:$result"
stage ← test
3stage="test"4case "$stage" invalues this stepteststagecase "$stage" in
3stage="test"4case "$stage" in5 test) command="mvn test"; result="pass" ;;values this stepteststagecommand ← mvn test, result ← pass
4case "$stage" in5 test) command="mvn test"; result="pass" ;;6 lint) command="shellcheck scripts"; result="pass" ;;values this stepmvn testcommandpassresultecho "$stage:$command:$result"
7esac8echo "$stage:$command:$result"outputtest:mvn test:passvalues this stepteststagemvn testcommandpassresult
stage ← lint
3stage="lint"4case "$stage" invalues this steplintstagecase "$stage" in
3stage="lint"4case "$stage" in5 test) command="mvn test"; result="pass" ;;values this steplintstagecommand ← shellcheck scripts, result ← pass
5 test) command="mvn test"; result="pass" ;;6 lint) command="shellcheck scripts"; result="pass" ;;7esacvalues this stepshellcheck scriptscommandpassresultecho "$stage:$command:$result"
7esac8echo "$stage:$command:$result"outputlint:shellcheck scripts:passvalues this steplintstageshellcheck scriptscommandpassresult
CI stage
A CI stage names one check in the automated pipeline.
gate
A gate reports pass or fail before later deployment steps run.
log line
Stable status lines make pipeline logs easy to scan.