]> git.donarmstrong.com Git - wannabuild.git/blob - bin/trigger-wrapper
Auto-committed schema changes.
[wannabuild.git] / bin / trigger-wrapper
1 #!/bin/bash
2
3 [ -n "$SSH_ORIGINAL_COMMAND" ] || exit 1
4
5 trigger_name=$(basename "$1")
6
7 set -- $SSH_ORIGINAL_COMMAND
8
9 shift
10 args="$*"
11 args=${args//[^a-zA-Z-]/}
12 args=${args,,}
13
14 # Ignore ftpsync stuff.
15 if [ "$args" = "syncall" -o "$args" = "sync:all" ]
16 then
17     args=""
18 fi
19
20 echo "$(date): $trigger_name | $args" >> /org/wanna-build/db/signal.log
21
22 if [ ! -z "$args" ]
23 then
24     # Pass arguments in the filename because we might get triggered for
25     # multiple suites.  A simple append wouldn't be race-free on the
26     # reader side.
27     touch "/org/wanna-build/signals/${trigger_name}.${args}"
28 else
29     touch "/org/wanna-build/signals/$trigger_name"
30 fi
31
32 exit 0
33