aboutsummaryrefslogtreecommitdiff
path: root/tools/buildsteps
diff options
context:
space:
mode:
authorMemphiz <memphis@machzwo.de>2013-03-27 19:47:06 +0100
committerMemphiz <memphis@machzwo.de>2013-03-27 20:19:56 +0100
commitb4c05c094d0c625bff09904af410c81a4083b81c (patch)
treed6992272958f27b6a55f22de5be4972396d20e16 /tools/buildsteps
parent279fec3734a268a15cd1c1f86fb02b13d8e89e77 (diff)
[jenkins] - add the branchname to the package names
Diffstat (limited to 'tools/buildsteps')
-rw-r--r--tools/buildsteps/defaultenv16
1 files changed, 14 insertions, 2 deletions
diff --git a/tools/buildsteps/defaultenv b/tools/buildsteps/defaultenv
index 4754b97831..8280cbdb35 100644
--- a/tools/buildsteps/defaultenv
+++ b/tools/buildsteps/defaultenv
@@ -105,8 +105,20 @@ function tagSuccessFulBuild ()
function getBuildRevDateStr ()
{
- git --no-pager log --abbrev=7 -n 1 --pretty=format:"%h %ci" HEAD | awk '{gsub("-", "");print $2"-"$1}' 2>/dev/null
- if [ "$?" != "0" ]; then
+ local revStr
+ #fetch date-rev
+ revStr=`git --no-pager log --abbrev=7 -n 1 --pretty=format:"%h %ci" HEAD | awk '{gsub("-", "");print $2"-"$1}' 2>/dev/null`
+ if [ "$?" == "0" ]
+ then
+ #fetch the first branch containing head
+ revStr=$revStr"-"`git branch -r --contains HEAD | head -n1 | awk '{gsub(".*/","");print $1}'`
+ if [ "$?" == "0" ]
+ then
+ echo $revStr
+ else
+ echo "Unknown"
+ fi
+ else
echo "Unknown"
fi
}