improve release script

Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
This commit is contained in:
Nico Schottelius 2011-11-18 15:45:59 +01:00
parent 092a9aa5b8
commit 32fa32bd52

View file

@ -1,25 +1,32 @@
#!/bin/sh -e #!/bin/sh
# Nico Schottelius
files="bin/cdist-config doc/changelog" files="doc/changelog lib/cdist/__init__.py"
# Stuff to take care of when doing a release # Stuff to take care of when doing a release
echo "Preparing next release" echo "Preparing next release"
# Ensure documentation builds cleanly # Ensure documentation builds cleanly
./build.sh clean && ./build.sh man echo "Testing documentation..."
./build clean && ./build man || exit 1
echo "Ensure you fixed/prepared version files: $files"
read wait
# get version # get version
version=$(awk -F'=' '/^__cdist_version/ { print $2 }' bin/cdist-config | sed 's/"//g') lib_version=$(grep ^VERSION lib/cdist/__init__.py | sed -e 's/.*= //' -e 's/"//g')
changelog_version=$(head -n1 doc/changelog | sed 's/:.*//')
git_version=$(git describe)
if [ "$lib_version" != "$changelog_version -o "$changelog_version" != "$git_version" ]; then
echo "Messed up versions, not releasing"
exit 1
fi
version=$git_version
# get target branch # get target branch
branch=${version%.?} branch=${version%.?}
# adjust version and release date
vi $files
# Commit stuff
git commit $files
# add tag # add tag
printf "Enter description for %s>" "$version" printf "Enter description for %s>" "$version"
read tagmessage read tagmessage
@ -31,5 +38,5 @@ git merge master
git checkout master git checkout master
# Publish manpages and sourcecode # Publish manpages and sourcecode
./build.sh web ./build web
./build.sh pub ./build pub