Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@sainoky
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sainoky/9566950 to your computer and use it in GitHub Desktop.
Save sainoky/9566950 to your computer and use it in GitHub Desktop.
#!/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