File: simple-webhook

package info (click to toggle)
webhook 2.8.0-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 11,064 kB
  • sloc: asm: 1,650; sh: 620; xml: 88; makefile: 50; ansic: 24
file content (28 lines) | stat: -rw-r--r-- 495 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh -e

# Create our hook command
cat <<EOF > $AUTOPKGTEST_TMP/hello
#!/bin/sh
echo -n hello
EOF
chmod 755  $AUTOPKGTEST_TMP/hello

# Create the hooks file
cat <<EOF > /etc/webhook.conf
[
  {
    "id": "hello",
    "include-command-output-in-response": true,
    "execute-command": "$AUTOPKGTEST_TMP/hello"
  }
]
EOF

systemctl restart webhook

sleep 2

if [ "$(curl --stderr /dev/null http://localhost:9000/hooks/hello)" != "hello" ]; then
    echo "Unexpected hook output"
    exit 1
fi