mirror of
https://github.com/vimagick/dockerfiles.git
synced 2025-12-21 13:23:02 +01:00
update webhook
This commit is contained in:
@@ -5,4 +5,54 @@ webhook
|
||||
to easily create HTTP endpoints (hooks) on your server, which you can use to
|
||||
execute configured commands.
|
||||
|
||||
## Directory Tree
|
||||
|
||||
```
|
||||
~/fig/webhook/
|
||||
├── docker-compose.yml
|
||||
└── scripts/
|
||||
├── hooks.json
|
||||
└── test.sh*
|
||||
```
|
||||
|
||||
docker-compose.yml
|
||||
|
||||
```
|
||||
webhook:
|
||||
image: vimagick/webhook
|
||||
command: -hooks hooks.json -verbose
|
||||
ports:
|
||||
- "9000:9000"
|
||||
volumes:
|
||||
- "./scripts:/scripts"
|
||||
|
||||
```
|
||||
|
||||
hooks.json
|
||||
|
||||
```
|
||||
[
|
||||
{
|
||||
"id": "test",
|
||||
"execute-command": "/scripts/test.sh",
|
||||
"command-working-directory": "/scripts"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
test.sh
|
||||
|
||||
```
|
||||
#!/bin/bash
|
||||
echo 'hello world'
|
||||
```
|
||||
|
||||
## Up and Running
|
||||
|
||||
```
|
||||
$ docker-compose up -d
|
||||
$ docker-compose logs
|
||||
$ curl localhost:9000/hooks/test
|
||||
```
|
||||
|
||||
[1]: https://github.com/adnanh/webhook
|
||||
|
||||
Reference in New Issue
Block a user