[Zope3-dev] Re: Releasing Zope 3.4
Martin Aspeli
optilude at gmx.net
Wed Apr 11 11:05:25 EDT 2007
FWIW, and in case it's helpful to someone, below is a (bash) script I
use to release the eggs I manage for Plone. Nothing magical at all, but
it's worked well for me.
It's semi-automatic, meaning that it asks you to review each step before
an svn commit.
I use 'ploneout', a zc.buildout of Plone 3, which puts all eggs in a
src/ sub-directory. I run this script from that directory, using
$ ./release-egg.sh plone.portlets 1.0b1 1.0b2
That means, release plone.portlets (which is the egg name, and also the
directory name where the source egg is found) version 1.0b1, uploading
it to the cheeseshop with an egg and a source tarball, from a tag with
the name /tags/1.0b1. After completion, trunk is set to version 1.0b2,
for continued development.
It's worked pretty well for two Plone pre-releases. With this script, it
takes me 15-20 minutes to release 12 or so eggs. If I removed some of
the safeguards, which ask to review svn diffs before commits, it'd
probably cut the time in half.
Usual caveats apply, of course. :)
Martin
#!/bin/bash
svn_base="https://svn.plone.org/svn/plone"
package=${1}
version=${2}
new_version=${3}
branch="trunk"
if test "${4}" != "" ; then
branch="branches/${4}"
fi
tag_url="${svn_base}/${package}/tags/${version}"
trunk_url="${svn_base}/${package}/${branch}"
cd ${package}
function update_versions() {
echo
echo "Updating version in setup.cfg"
mv setup.py setup.py.old
cat setup.py.old | sed "s/^version = .*$/version = '${1}'/" > setup.py
rm setup.py.old
echo
echo "Updating any version.txt files"
for f in $(find . -name 'version.txt') ; do
echo "${1}" > ${f}
done
}
echo
echo "-> Please revise setup.py. Version will be handled separately."
${EDITOR} setup.py
echo
echo "-> Committing current trunk"
svn status
svn diff
read -p "press any key to continue"
svn commit -m "Updating setup.py"
echo
echo "-> Tagging release in subversion at ${tag_url}"
read -p "press any key to continue"
svn cp -m "Tagging ${version}" . "${tag_url}"
echo
echo "-> Switching to tag"
svn switch "${tag_url}"
update_versions "${version}"
echo
echo "-> Removing setup.cfg"
svn rm setup.cfg
echo
echo "-> About to commit changes to tag"
svn status
svn diff
read -p "press any key to continue"
svn commit -m "Updating version and removing setup.cfg for the tag"
echo
echo "-> Cheesing it up"
export COPY_EXTENDED_ATTRIBUTES_DISABLE=true
python setup.py egg_info -RDb "" sdist bdist_egg register upload
echo
echo "-> Switching back to trunk"
svn switch "${trunk_url}"
update_versions "${new_version}"
echo
echo "-> About to commit new version to trunk"
svn status
svn diff
read -p "press any key to continue"
svn commit -m "Updating version on trunk after tagging"
echo
echo "-> All done"
cd ..
More information about the Zope3-dev
mailing list