Created
February 21, 2011 15:56
-
-
Save jperras/837253 to your computer and use it in GitHub Desktop.
Pivotal Tracker SVN Post-Commit Hook
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/sh | |
set -e | |
REPO="$1" | |
REV="$2" | |
AUTHOR=`/usr/bin/svnlook author $REPO -r $REV` | |
MESSAGE=`/usr/bin/svnlook log $REPO -r $REV` | |
# You must HTML-escape the XML post data | |
MESSAGE=${MESSAGE//&/&} | |
MESSAGE=${MESSAGE//</<} | |
MESSAGE=${MESSAGE//>/>} | |
# This is just a simple example. You also need to handle the AUTHOR, as well as quotes, backticks, etc... | |
# If you have a better one, please let us know, and we'll add it to the list of Tracker 3rd Party Tools | |
# at http://pivotaltracker.com/help/thirdpartytools. | |
RESPONSE=`curl -H "X-TrackerToken: TOKEN" -X POST -H "Content-type: application/xml" \ | |
-d "<source_commit><message>$MESSAGE</message><author>$AUTHOR</author><commit_id>$REV</commit_id></source_commit>" \ | |
http://www.pivotaltracker.com/services/v3/source_commits` | |
echo $RESPONSE >> /tmp/tracker_post_commit.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Required syntax:
[#12345678] Diverting power from warp drive to torpedoes.
This adds the above comment to the given story #. Can also use [Fixes #12345678] or [Delivers #12345678]