#!/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 "{\"configs\":[{\"outputs\":[{\"str\":\"${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