Tagged releases

This patch modifies release.sh and version.py for tagged releases

Change-Id: I8af98e91ac7fbf3cf7a937bff8a707d4be36cba6
This commit is contained in:
Martin Mágr 2015-05-01 15:13:42 +02:00
parent ba5183c508
commit 29b18bc93b
2 changed files with 15 additions and 19 deletions

View File

@ -4,19 +4,16 @@ SCRIPT_PATH="${BASH_SOURCE[0]}"
SCRIPT_DIR=`dirname $SCRIPT_PATH`
cd $SCRIPT_DIR/..
git reset --hard
if [ -n "$1" ] ; then
git tag -a -m $1 $1
# tagged release
BRANCH=`git rev-parse --abbrev-ref HEAD`
git fetch gerrit
git tag -m $1 -s $1 gerrit/$BRANCH
git push gerrit tag $1
else
# development release
VERSION=`python setup.py --version`
sed -i -e "s/RESERVE_STR = None/RESERVE_STR = '$VERSION'/g" packstack/version.py
python setup.py sdist
git checkout packstack/version.py
fi
VERSION=`python setup.py --version`
sed -i -e "s/RESERVE_STR = None/RESERVE_STR = '$VERSION'/g" packstack/version.py
python setup.py sdist
if [ -n "$1" ] ; then
echo "Packstack was released with tag '$1'. Please don't forget to push tag upstream (git push --tags)."
fi
git checkout packstack/version.py

View File

@ -48,6 +48,7 @@ def vr_from_git():
tag, snap_tag, git_hash = description.split('-')
else:
# no tag has been found
tag = '.'.join(VERSION)
rc, git_hash = execute(
'git log -n1 --pretty=format:%h',
workdir=proj_dir,
@ -61,11 +62,9 @@ def vr_from_git():
use_shell=True,
log=False
)
return '{0}.dev{1}.{2}'.format(
'.'.join(VERSION),
snap_tag.strip(),
git_hash.strip(),
)
tag, snap_tag, git_hash = tag.strip(), snap_tag.strip(), git_hash.strip()
return '{tag}.dev{snap_tag}.{git_hash}'.format(**locals())
def vr_from_setuptools():