Skip to content
This repository
Browse code

[jenkins] - add the branchname to the package names

  • Loading branch information...
commit b4c05c094d0c625bff09904af410c81a4083b81c 1 parent 279fec3
Memphiz authored

Showing 1 changed file with 14 additions and 2 deletions. Show diff stats Hide diff stats

  1. 16  tools/buildsteps/defaultenv
16  tools/buildsteps/defaultenv
@@ -105,8 +105,20 @@ function tagSuccessFulBuild ()
105 105
 
106 106
 function getBuildRevDateStr ()
107 107
 {
108  
-  git --no-pager log --abbrev=7 -n 1 --pretty=format:"%h %ci" HEAD | awk '{gsub("-", "");print $2"-"$1}' 2>/dev/null
109  
-  if [ "$?" != "0" ]; then
  108
+  local revStr
  109
+  #fetch date-rev
  110
+  revStr=`git --no-pager log --abbrev=7 -n 1 --pretty=format:"%h %ci" HEAD | awk '{gsub("-", "");print $2"-"$1}' 2>/dev/null`
  111
+  if [ "$?" == "0" ]
  112
+  then
  113
+    #fetch the first branch containing head
  114
+    revStr=$revStr"-"`git branch -r --contains HEAD | head -n1 | awk '{gsub(".*/","");print $1}'`
  115
+    if [ "$?" == "0" ]
  116
+    then
  117
+      echo $revStr
  118
+    else
  119
+      echo "Unknown"
  120
+    fi
  121
+  else
110 122
     echo "Unknown"
111 123
   fi
112 124
 }

0 notes on commit b4c05c0

Please sign in to comment.
Something went wrong with that request. Please try again.