From ec5d74d59a26192288f1430581e2a27567f91b86 Mon Sep 17 00:00:00 2001
From: Tomas Kulhanek <tomas.kulhanek@stfc.ac.uk>
Date: Tue, 22 Jan 2019 12:05:16 +0000
Subject: Update jenkins-build.sh

---
 build/jenkins-build.sh | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/build/jenkins-build.sh b/build/jenkins-build.sh
index de22368..e440717 100755
--- a/build/jenkins-build.sh
+++ b/build/jenkins-build.sh
@@ -4,19 +4,20 @@ if [[ -n ${CIL_VERSION} ]]
 then
   echo Using defined version: $CIL_VERSION
 else
-
-#get tag, remove first char ('v') and leave rest
-export CIL_VERSION=`git describe --tags | tail -c +2`  
-if [[ ${CIL_VERSION} == *"-"* ]]; then
-  # detected dash means that it is dev version
-  # version is then string-string and all after second dash is ignored (usually commit sha)
-  export CIL_VERSION=`echo ${CIL_VERSION} | cut -d "-" -f -2`
-  # but dash is prohibited for conda build, replace with underscore
-  export CIL_VERSION=`echo ${CIL_VERSION} | tr - _`
-  echo Building dev version ${CIL_VERSION}
-else
-  echo Defining version from last git tag and commit: $CIL_VERSION
-fi 
+  # define CIL_VERSION from last git tag, remove first char ('v') and leave rest
+  export CIL_VERSION=`git describe --tags | tail -c +2`  
+  # dash means that it's some commit after tag release -thus will be treated as dev
+  if [[ ${CIL_VERSION} == *"-"* ]]; then
+    # detected dash means that it is dev version
+    # version is then string-string and all after second dash is ignored (usually commit sha)
+    export CIL_VERSION=`echo ${CIL_VERSION} | cut -d "-" -f -2`
+    # but dash is prohibited for conda build, replace with underscore
+    export CIL_VERSION=`echo ${CIL_VERSION} | tr - _`
+    echo Building dev version ${CIL_VERSION}
+  else
+    echo Defining version from last git tag and commit: $CIL_VERSION
+  fi
+fi
 
 # Script to builds source code in Jenkins environment
 # module try-load conda
@@ -49,7 +50,7 @@ then
   conda install anaconda-client
   while read -r outfile; do
     #if 0 commit after tag then call anaconda without --label dev
-    #TODO if pull request??? do not upload 
+    #TODO pull request not to upload 
     if [[ $CIL_VERSION == *"_"* ]]; then
       # upload with dev label
       anaconda -v -t ${CCPI_CONDA_TOKEN}  upload $outfile --force --label dev
-- 
cgit v1.2.3