Skip to content

Commit

Permalink
Use a trap to kill /opt/go/out when term is sent by concourse
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Harden <[email protected]>
  • Loading branch information
jfharden committed May 15, 2024
1 parent 0c9657a commit 5b3631d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion assets/out
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,13 @@ git_config_payload=$(jq -r '.source.git_config // []' < $payload)

configure_git_global "${git_config_payload}"

/opt/go/out $1 >&3 < $payload
_terminate() {
kill -TERM "$child" 2>/dev/null
}

trap _terminate TERM

/opt/go/out $1 >&3 < $payload &

child=$!
wait "$child"

0 comments on commit 5b3631d

Please sign in to comment.