Last active
August 29, 2015 13:57
-
-
Save sainoky/9566950 to your computer and use it in GitHub Desktop.
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/sh | |
if test $# -ne 3; then | |
echo "usage: $0 <Jenkins job URL> <project> <Git dir>" | |
exit 1 | |
fi | |
JOB_URL=$1 | |
PROJECT=$2 | |
GIT_DIR=$3 | |
# Assumes the Build ID is saved as buildid.txt | |
BUILDID=`curl $JOB_URL/buildid.txt` | |
HASH=`curl $JOB_URL/manifest_static.xml | \ | |
grep $PROJECT | sed 's/.*revision="\([0-9a-f]*\)".*/\1/'` | |
git --git-dir $GIT_DIR tag -f $BUILDID $HASH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment