Skip to content
Snippets Groups Projects
Commit 7f2ef061 authored by Julien Bonjean's avatar Julien Bonjean
Browse files

[#1317] Centralized version handling

parent 40421372
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# Author: Julien Bonjean (julien@bonjean.info) # Author: Julien Bonjean (julien@bonjean.info)
# #
# Creation Date: 2009-04-20 # Creation Date: 2009-04-20
# Last Modified: 2009-05-28 17:59:14 -0400 # Last Modified: 2009-05-28 18:30:17 -0400
##################################################### #####################################################
# #
...@@ -62,7 +62,6 @@ PACKAGING_RESULT_DIR=${ROOT_DIR}/packages-${TAG} ...@@ -62,7 +62,6 @@ PACKAGING_RESULT_DIR=${ROOT_DIR}/packages-${TAG}
USER="sflphone" USER="sflphone"
RELEASE_MODE= RELEASE_MODE=
VERSION_APPEND=
SNAPSHOT_TAG=`date +%s` SNAPSHOT_TAG=`date +%s`
...@@ -198,11 +197,8 @@ echo ...@@ -198,11 +197,8 @@ echo
if [ ${RELEASE_MODE} ]; then if [ ${RELEASE_MODE} ]; then
echo "Release mode : ${RELEASE_MODE}" echo "Release mode : ${RELEASE_MODE}"
if [ "${RELEASE_MODE}" != "release" ];then
VERSION_APPEND="~${RELEASE_MODE}"
fi
else else
echo "Snapshot mode" echo "Snapshot mode : ${SNAPSHOT_TAG}"
fi fi
######################### #########################
...@@ -227,13 +223,22 @@ if [ ${DO_PREPARE} ]; then ...@@ -227,13 +223,22 @@ if [ ${DO_PREPARE} ]; then
VERSION=`cd ${REPOSITORY_DIR} && git describe --tag HEAD | cut -d "/" -f2 | cut -d "-" -f1` VERSION=`cd ${REPOSITORY_DIR} && git describe --tag HEAD | cut -d "/" -f2 | cut -d "-" -f1`
if [ ${RELEASE_MODE} ]; then
if [ "${RELEASE_MODE}" != "release" ];then
VERSION="${VERSION}~${RELEASE_MODE}"
fi
else
VERSION="${VERSION}-snapshot-${SNAPSHOT_TAG}"
fi
echo "Version is : ${VERSION}"
# if push is activated # if push is activated
if [ ${DO_PUSH} ];then if [ ${DO_PUSH} ];then
# first changelog generation for commit # first changelog generation for commit
echo "Update debian changelogs (1/2)" echo "Update debian changelogs (1/2)"
${SCRIPTS_DIR}/sfl-git-dch.sh ${SNAPSHOT_TAG} ${RELEASE_MODE} ${SCRIPTS_DIR}/sfl-git-dch.sh ${VERSION} ${RELEASE_MODE}
if [ "$?" -ne "0" ]; then if [ "$?" -ne "0" ]; then
echo "!! Cannot update debian changelogs" echo "!! Cannot update debian changelogs"
...@@ -241,12 +246,9 @@ if [ ${DO_PREPARE} ]; then ...@@ -241,12 +246,9 @@ if [ ${DO_PREPARE} ]; then
fi fi
echo " Doing commit" echo " Doing commit"
VERSION_COMMIT=${VERSION}${VERSION_APPEND}
if [ ! ${RELEASE_MODE} ]; then
VERSION_COMMIT="${VERSION}-${SNAPSHOT_TAG}"
fi
cd ${REPOSITORY_DIR} cd ${REPOSITORY_DIR}
git commit -m "[#1262] Updated debian changelogs (${VERSION_COMMIT})" . >/dev/null git commit -m "[#1262] Updated debian changelogs (${VERSION})" . >/dev/null
echo " Pushing commit" echo " Pushing commit"
git push origin master >/dev/null git push origin master >/dev/null
...@@ -271,10 +273,10 @@ if [ ${DO_PREPARE} ]; then ...@@ -271,10 +273,10 @@ if [ ${DO_PREPARE} ]; then
fi fi
echo "Write version numbers for following processes" echo "Write version numbers for following processes"
echo "${VERSION_COMMIT}" > ${REPOSITORY_DIR}/sflphone-common/VERSION echo "${VERSION}" > ${REPOSITORY_DIR}/sflphone-common/VERSION
echo "${VERSION_COMMIT}" > ${REPOSITORY_DIR}/sflphone-client-gnome/VERSION echo "${VERSION}" > ${REPOSITORY_DIR}/sflphone-client-gnome/VERSION
echo "${VERSION_COMMIT}" > ${REPOSITORY_DIR}/sflphone-client-kde/VERSION echo "${VERSION}" > ${REPOSITORY_DIR}/sflphone-client-kde/VERSION
echo "${VERSION_COMMIT}" > ${TODEPLOY_BUILD_DIR}/VERSION echo "${VERSION}" > ${TODEPLOY_BUILD_DIR}/VERSION
echo "Archiving repository" echo "Archiving repository"
tar czf ${REPOSITORY_ARCHIVE} --exclude .git -C `dirname ${REPOSITORY_DIR}` sflphone tar czf ${REPOSITORY_ARCHIVE} --exclude .git -C `dirname ${REPOSITORY_DIR}` sflphone
......
...@@ -7,12 +7,12 @@ ...@@ -7,12 +7,12 @@
# Author: Julien Bonjean (julien@bonjean.info) # Author: Julien Bonjean (julien@bonjean.info)
# #
# Creation Date: 2009-05-13 # Creation Date: 2009-05-13
# Last Modified: 2009-05-28 18:04:12 -0400 # Last Modified: 2009-05-28 18:24:53 -0400
##################################################### #####################################################
# set -x # set -x
SNAPSHOT_TAG=$1 VERSION=$1
RELEASE_MODE=$2 RELEASE_MODE=$2
ROOT_DIR="/home/projects/sflphone" ROOT_DIR="/home/projects/sflphone"
...@@ -83,28 +83,6 @@ if [ "$?" -ne "0" ]; then ...@@ -83,28 +83,6 @@ if [ "$?" -ne "0" ]; then
exit -1 exit -1
fi fi
# get version
SOFTWARE_VERSION=`echo ${LAST_RELEASE_TAG_NAME} | cut -d "/" -f2- | cut -d "-" -f1`
if [ "$?" -ne "0" ]; then
echo " !! Error when retrieving software version"
exit -1
fi
# add version info
SOFTWARE_VERSION_APPEND=
if [ ${RELEASE_MODE} ]
then
if [ "${RELEASE_MODE}" != "release" ]; then
SOFTWARE_VERSION_APPEND="~${RELEASE_MODE}"
fi
else
SOFTWARE_VERSION_APPEND="~snapshot${SNAPSHOT_TAG}"
fi
# iterate throw changelog files # iterate throw changelog files
for CHANGELOG_FILE in ${CHANGELOG_FILES[@]} for CHANGELOG_FILE in ${CHANGELOG_FILES[@]}
do do
...@@ -141,7 +119,7 @@ do ...@@ -141,7 +119,7 @@ do
if [ ${IS_FIRST} ] if [ ${IS_FIRST} ]
then then
yes | dch --changelog ${CHANGELOG_FILE} -b --allow-lower-version --no-auto-nmu --distribution SYSTEM --newversion ${SOFTWARE_VERSION}${SOFTWARE_VERSION_APPEND}-SYSVER "$line" >/dev/null 2>&1 yes | dch --changelog ${CHANGELOG_FILE} -b --allow-lower-version --no-auto-nmu --distribution SYSTEM --newversion ${VERSION}-SYSVER "$line" >/dev/null 2>&1
if [ "$?" -ne "0" ]; then if [ "$?" -ne "0" ]; then
echo echo
...@@ -164,13 +142,13 @@ do ...@@ -164,13 +142,13 @@ do
# add snapshot or release flag if needed # add snapshot or release flag if needed
echo echo
if [ ${RELEASE_MODE} ]; then if [ ${RELEASE_MODE} ]; then
sed -i "3i\ ** ${SOFTWARE_VERSION} ${RELEASE_MODE} **\n" ${CHANGELOG_FILE} sed -i "3i\ ** ${VERSION} **\n" ${CHANGELOG_FILE}
if [ "$?" -ne "0" ]; then if [ "$?" -ne "0" ]; then
echo " !! Error when adding snapshot flag" echo " !! Error when adding snapshot flag"
exit -1 exit -1
fi fi
else else
sed -i "3i\ ** SNAPSHOT ${SNAPSHOT_TAG} **\n" ${CHANGELOG_FILE} sed -i "3i\ ** SNAPSHOT ${VERSION} **\n" ${CHANGELOG_FILE}
if [ "$?" -ne "0" ]; then if [ "$?" -ne "0" ]; then
echo " !! Error when adding snapshot flag" echo " !! Error when adding snapshot flag"
exit -1 exit -1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment