Last active
August 29, 2015 14:22
-
-
Save reidmv/4205d0a68e4efa757680 to your computer and use it in GitHub Desktop.
post-receive hook for r10k bare git repo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
url='http://puppetmaster.local:8088/payload' | |
branches='' | |
while read oldrev newrev refname; do | |
branch=$(echo $refname | sed -n 's/^refs\/heads\///p') | |
branches="${branches} ${branch}" | |
done | |
branches=$(echo $branches | tr ' ' '\n' | sort -u) | |
for branch in $branches; do | |
data="{\"ref\": \"${branch}\"}" | |
curl -k -H "content-type: application/json" --data "$data" "$url" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment