From 74a97294a8154cb8e6b50f6d65e28afa9f06ec6d Mon Sep 17 00:00:00 2001
From: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
Date: Wed, 16 Jul 2014 10:05:01 -0400
Subject: [PATCH] release: update release script to checkout the release tag

It is better to get rid of the release branch and use the tag instead to
build the packages. This is a quick first draft that should work for
1.4.0, but it needs to be reworked a little before the next release.

Refs #51465

Change-Id: I26840fe86a9e85e7d64b97b3095a7b19a5427520
---
 tools/build-system/launch-build-machine-jenkins.sh | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/tools/build-system/launch-build-machine-jenkins.sh b/tools/build-system/launch-build-machine-jenkins.sh
index 4ac83f90be..9891a5f2b8 100755
--- a/tools/build-system/launch-build-machine-jenkins.sh
+++ b/tools/build-system/launch-build-machine-jenkins.sh
@@ -131,10 +131,11 @@ fi
 cd ${REFERENCE_REPOSITORY}
 
 echo "Update reference sources"
+git checkout . && git checkout -f master && git pull
+
+# If release, checkout the latest tag
 if [ ${IS_RELEASE} ]; then
-        git checkout . && git checkout -f release && git pull
-else
-        git checkout . && git checkout -f master && git pull
+  git checkout ${VERSION_NUMBER}
 fi
 
 echo "Retrieve build info"
@@ -143,8 +144,11 @@ if [ ${IS_KDE_CLIENT} ]; then
 	TAG_NAME_PREFIX="kde."
 	LAUNCHPAD_PACKAGES=( "sflphone-kde" )
 fi
+
+# Get the version
 CURRENT_RELEASE_TAG_NAME=`git describe --tags --abbrev=0`
 PREVIOUS_RELEASE_TAG_NAME=`git describe --tags --abbrev=0 ${CURRENT_RELEASE_TAG_NAME}^`
+
 CURRENT_RELEASE_COMMIT_HASH=`git show --pretty=format:"%H" -s ${CURRENT_RELEASE_TAG_NAME} | tail -n 1`
 PREVIOUS_RELEASE_COMMIT_HASH=`git show --pretty=format:"%H" -s ${PREVIOUS_RELEASE_TAG_NAME} | tail -n 1`
 CURRENT_COMMIT=`git show --pretty=format:"%H"  -s | tail -n 1`
-- 
GitLab