[molecule] add version tagging script, fix version handling

This commit is contained in:
Fabio Erculiani
2010-05-16 15:28:08 +02:00
parent 53657e82aa
commit deb751de7f
4 changed files with 53 additions and 4 deletions
+1 -3
View File
@@ -1,4 +1,2 @@
- add i18n support
- add real plugin factory
- move version string to file
- add build system
- add real plugin factory
+2 -1
View File
@@ -21,6 +21,7 @@ from molecule.exception import SpecFileError
from molecule.specs.plugins import SPEC_PLUGS
from molecule.specs.plugins.builtin import LivecdSpec
from molecule.specs.skel import GenericSpec
from molecule.version import VERSION
import molecule.utils
class Constants(dict):
@@ -51,7 +52,7 @@ class Configuration(dict):
if mysettings is None:
mysettings = {}
settings = {
'version': "0.5.4",
'version': VERSION,
'chroot_compressor': "mksquashfs",
'iso_builder': "mkisofs",
'mirror_syncer': "rsync",
+20
View File
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Molecule Disc Image builder for Sabayon Linux
# Copyright (C) 2009 Fabio Erculiani
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# DO NOT CHANGE THIS FILE AND THIS VARIABLE MANUALLY
VERSION = "0.5.5"
+30
View File
@@ -0,0 +1,30 @@
#!/bin/sh
# Check current dir
[[ ! -d ".git" ]] && echo "this script must be executed from git repo root" && exit 1
# Check target tag
[[ -z "$1" ]] && echo "usage: $0 <new-version>" && exit 1
# Validate new version
new_tag="$1"
for cur_tag in `git tag`; do
[[ "$cur_tag" == "$new_tag" ]] && echo "$new_tag already tagged" && exit 1
done
# Update ChangeLog
echo "Updating ChangeLog for $new_tag"
git log > docs/ChangeLog
git add docs/ChangeLog
sed -i "s/^VERSION = \".*\"/VERSION = \"$new_tag\"/" molecule/version.py
git add molecule/version.py
git commit -m "Tagging Molecule version $new_tag" docs/ChangeLog \
molecule/version.py
# tag version
echo "Tagging version: $new_tag"
git tag $new_tag HEAD
# Push changes upstream
git push
git push --tags