#!/bin/bash
# Path: /path/to/gitbucket/data/repositories/USER/REPO.git/hooks/post-receive
set -x
while read oldrev newrev refname; do
  # Call Jenkins
  curl -X POST "https://jenkins.jasonpoage.com/generic-webhook-trigger/invoke" \
    --data-urlencode "branch=$refname" \
    --data-urlencode "oldrev=$oldrev" \
    --data-urlencode "newrev=$newrev"
done
