databuild/examples/basic_job/unified_job.sh
Stuart Axelbrooke bdd8fd7e0d
Some checks are pending
/ setup (push) Waiting to run
Fix tests
2025-06-29 20:24:44 -07:00

21 lines
No EOL
586 B
Bash
Executable file

#!/bin/bash
# Simple unified job that handles both config and exec via subcommands
case "${1:-}" in
"config")
# Configuration mode - output job config JSON
partition_ref="${2:-}"
echo "[{\"outputs\":[\"${partition_ref}\"],\"inputs\":[],\"args\":[\"will\", \"build\", \"${partition_ref}\"],\"env\":{\"foo\":\"bar\"}}]"
;;
"exec")
# Execution mode - run the job
echo 'EXECUTE UNIFIED!'
echo "foo=$foo"
echo "args=$@"
;;
*)
echo "Usage: $0 {config|exec} [args...]"
exit 1
;;
esac