https://github.com/vietdien2005/gitlab-webhook
Simple Gitlab webook receive job events (status success or failed) and notify to Telegram
https://github.com/vietdien2005/gitlab-webhook
gitlab telegram webhook
Last synced: about 2 months ago
JSON representation
Simple Gitlab webook receive job events (status success or failed) and notify to Telegram
- Host: GitHub
- URL: https://github.com/vietdien2005/gitlab-webhook
- Owner: vietdien2005
- License: mit
- Created: 2020-11-11T09:48:24.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-08-09T07:16:31.000Z (almost 5 years ago)
- Last Synced: 2025-03-28T07:44:00.636Z (about 1 year ago)
- Topics: gitlab, telegram, webhook
- Language: Python
- Homepage:
- Size: 9.77 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Gitlab Webhook
> Simple Gitlab webook receive job events (status success or failed) and notify to Telegram
## Configuration
### Command
- Command: `python3 webhook.py --port 8989 --config ./config.yaml`
### Example config
```yaml
# file: config.yaml
---
project/gitlab-repo:
gitlab_token: your-token
telegram_bot: your-telegram-bot-token
telegram_group: your-telegram-group-id
telegram_template: ./templates/your-template.jinja
```
## Command Arguments
- Port: Define the listen port for the webserver. Default: **8666**
- Address: Define the listen address for the webserver. Default: **0.0.0.0**
- Config: Define the path to your configuration file. Default: **config.yaml**
## Help
```bash
usage: webhook.py [-h] [--address ADDRESS] [--port PORT] --config CONFIG
Gitlab Webhook
optional arguments:
-h, --help show this help message and exit
--address ADDRESS address where it listens (default: 0.0.0.0)
--port PORT port where it listens (default: 8989)
--config CONFIG path to the config file (default: None)
```
## Systemd
```service
[Unit]
Description=Gitlab Webhook
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
WorkingDirectory=/opt/gitlab_webhook/
ExecStart=webhook.py --port 8989 --config /opt/gitlab_webhook/config.yaml
[Install]
WantedBy=multi-user.target
```
## Docker
- Build image: `docker-compose build` or Pull Image: `docker-compose pull`
- Run: `docker-compose up` or `docker-compose up -d`
- Run without docker-compose:
```bash
docker run -d \
-p 8989 \
-v ${PWD}/config.yaml:/workspace/config.yaml \
--name gitlab_webhook \
vietdien2005/gitlab_webhook:latest
```