# README
Webhook
A simple auto deploy tools.
Requirement
- setup GOPATH and GOROOT environment variables
- go 1.18+
- ubuntu / linux / debian
Installation (for Ubuntu/Linux)
- install binary
go install github.com/juxuny/webhook@latest
- create a linux service config file in /etc/systemd/system
[Unit]
Description=Webhook
After=network.target
[Service]
Type=simple
User=juxuny
Restart=on-failure
RestartSec=5s
ExecStart=/mnt/tools/gopath/bin/webhook serve -c /home/juxuny/.config/webhook/config.yaml
[Install]
WantedBy=multi-user.target
Notice: You should modify the real path for yourself.
- create a YAML config file, look like this:
port: 20089
url-prefix: /hook
auth:
- name: nuc
token: {{token}}
deployments:
- name: test-api-dev
bash-interpreter: /bin/bash
work-dir: .
variables:
- name: tag
nullable: false
type: string
scripts:
- test.sh
- enable the system service
sudo systemctl daemon-reload
sudo systemctl enable webhook
- check running status
sudo service webhook status
- trigger the deployment
curl -X POST -d 'tag=test-api-dev' http://127.0.0.1:20089/hook/test-api-dev
# Functions
No description provided by the author
No description provided by the author