File tree Expand file tree Collapse file tree
docker/swarm/stacks/oncall Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -115,19 +115,25 @@ Trigger an on-demand Gantry update from a GitHub Actions workflow:
115115
116116## Testing Webhook
117117
118- Manual curl examples for verifying the webhook service :
118+ Run from the manager node ( ` ssh freecodecamp@ops-vm-backoffice`) :
119119
120120` ` ` bash
121- # Valid request (with secret header)
121+ # Trigger update for a specific service
122122curl -X POST http://localhost:9889/hooks/run-gantry \
123123 -H "Content-Type: application/json" \
124- -H "X-Webhook-Secret : YOUR_SECRET_HERE " \
125- -d '{"GANTRY_SERVICES_FILTERS":"name=mystack_myservice "}'
124+ -H "X-Webhook-Secret: $WEBHOOK_SECRET " \
125+ -d '{"GANTRY_SERVICES_FILTERS":"name=<stack>_<service> "}'
126126
127- # Invalid request (without secret — should be rejected )
127+ # Trigger update for all autoupdate-labeled services (no filter )
128128curl -X POST http://localhost:9889/hooks/run-gantry \
129129 -H "Content-Type: application/json" \
130- -d '{"GANTRY_SERVICES_FILTERS":"name=mystack_myservice"}'
130+ -H "X-Webhook-Secret: $WEBHOOK_SECRET" \
131+ -d '{}'
132+
133+ # Invalid request (no secret — should return "Hook rules were not satisfied")
134+ curl -X POST http://localhost:9889/hooks/run-gantry \
135+ -H "Content-Type: application/json" \
136+ -d '{}'
131137
132138# Check webhook logs
133139docker service logs oncall_svc-webhook
You can’t perform that action at this time.
0 commit comments