A webhook watcher service for Boo's git repo. It is used for automated deployments
- Make sure
go
is installed - Installation steps here
- Place the deploy.sh file under
/home/ifkash
- Make the deploy.sh executable by running
chmod +x deploy.sh
- The current user for this is
ifkash
- Place the webgook_server.go file under
/home/ifkash
- Build the executable
go build -o webhook_server webhook_server.go
- Set up a systemd service to run the webhook server. Create a file
/etc/systemd/system/webhook-server.service
[Unit]
Description=GitHub Webhook Server
After=network.target
[Service]
User=ifkash
WorkingDirectory=/home/ifkash
ExecStart=/home/ifkash/webhook_server
Restart=always
[Install]
WantedBy=multi-user.target
- Reload the systemd daemon and restart the service
sudo systemctl daemon-reload
sudo systemctl restart webhook-server
- Go to repo settings, navigate to webhooks
- Add/Edit a webhook
- Set the payload URL to
http://GCP_VM_IP:5000/webhook
- Ensure the content type is set to
application/json
- Select "Just the push event" for the trigger
To monitor logs for the systemd service
sudo journalctl -u webhook-server -f