Created
March 10, 2013 07:36
-
-
Save chrisdickinson/5127523 to your computer and use it in GitHub Desktop.
add testling ci hooks
This file contains 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=$(git remote -v | grep origin | head -n 1 | awk '{print $2}') | |
path=$(node -e 'var url = require("url"), _ = "'$url'"; if(_.indexOf("://") === -1) { _ = _.replace(":", "/"); _ = "ssh://"+_; }; _ = url.parse(_);console.log(_.pathname.replace(/\.git$/, "").slice(1));') | |
curl -X POST -H "Authorization: Token $(cat ~/.github-token)" -d '{"name":"web", "config":{"url": "http://git.testling.com/", "content_type": "form"}}' https://api.github.com/repos/$path/hooks 2>/dev/null 1>/dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment