Every open source project that makes regular releases ends up scripting the release cycle: tagging revisions, making tarballs, uploading to ftp/website, and so on. Often these are a bunch of Makefile rules or shell scripts cobbled together and not quite robust.
PRAT is a coherent set tools that grew out of the union of such scripts from multiple projects. It is optimized for use with projects that use Subversion.1 (The scripts were originally developed for BOINC, and PRAT was first used by QuickyPix.)
PRAT projects use a Subversion directory hierarchy like this:
The tags in the Subversion repository are the master copy as far as releases go. Tarballs are automatically generated; thus they are caches. See my essay, The Master Copy.
Create a file admin/prat-config.py like so:
PROJ_NAME = 'foo' REPO_BASE = 'https://svn.cubewano.org/repos/%(PROJ_NAME)s'%locals() REPO_TRUNK = '%(REPO_BASE)s/trunk/%(PROJ_NAME)s'%locals() REPO_TAG_DIR = '%(REPO_BASE)s/tags'%locals() RELEASES_DIR = '/home/quarl/proj/%(PROJ_NAME)s/www/releases'%locals()
See Config files for more information.
Without PRAT, you would manually run, for example:
svn cp http://svn/repos/trunk/foo http://svn/repos/tags/v1.0
With PRAT, instead:
prat-tag-release v1.0
Or, if you use version.py (see Config files), simply:
prat-tag-release
Since the tarball releases are a cache of the repository tags master copy, at any point you can run:
prat-make-releases
to generate the .tar.gz, .tar.bz2, and .zip files for all versions that have ever been tagged. Tarballs that already exist are skipped. It is idempotent, i.e., if you run it twice successively, the second time is a no-op. It is a function of the Subversion repository state (to the extent that tar/gzip/bzip2/zip are functions of the input files).
PRAT can also update documentation to reflect version numbers, dates, URLs:
prat-update-doc
Currently, PRAT outputs Docutils-formatted text, defining substitution text and URL references. This document itself uses prat-update-doc.
| [1] | CVS, Arch, etc. support can be added. Some subcomponents support CVS since they were originally designed for CVS. |
Browse/checkout the Subversion repository:
svn checkout http://svn.cubewano.org/repos/prat/trunk/prat/
PRAT 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.
PRAT 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.