← Back to team overview

ufl team mailing list archive

Re: Ready for release?

 

On Thu, Dec 03, 2009 at 10:45:21PM +0000, Garth N. Wells wrote:
>
>
> Anders Logg wrote:
> > On Thu, Dec 03, 2009 at 04:35:41PM +0000, Garth N. Wells wrote:
> >> Are we all set for release 0.4.1 of UFL?
> >>
> >> Garth
> >
> > Yes!
> >
> > We need to update the fenics-release script. I'll add it on the
> > Launchpad page for FEniCS later.
> >
>
> If you could push the release script (I don't have a copy) we can start
> making releases of UFL, FFC and DOLFIN.

I don't have time to do the bzr thing now, but I've attached the
script if you want to start.

It needs updating for the changed location of things. I'll try to
clean it up tomorrow but feel free to have a look.

--
Anders
#!/bin/bash
#
# Copyright (C) Anders Logg 2009.
# Licensed under the GNU GPL Version 3 or any later version.
#
# First added:  2009-10-09
# Last changed: 2009-11-11
#
# Parts of this script copied from Dorsal.
#
# This script creates a new release based on the configuration
# found in release.conf found in the current directory.

# Parameters
CONF_FILE="release.conf"
PACKAGE=""

# Set editor
if [ "x$EDITOR" = "x" ]; then
    EDITOR="emacs -nw"
fi

# Colours for progress and error reporting
BAD="\033[1;37;41m"
GOOD="\033[1;37;42m"
BOLD="\033[1m"

# Function for printing messages
cecho()
{
    COL=$1; shift
    echo -e "${COL}$@\033[0m"
}

# Empty package-specific post-release function
post-release()
{
    echo "No package-specific post-release tasks"
}

# Read configuration
if [ -f $CONF_FILE ]; then
    source $CONF_FILE
else
    cecho $BAD "Unable to read configuration file $CONF_FILE."
    exit 1
fi

# Check variables
if [ "x$PACKAGE" = "x" ]; then
    cecho $BAD "Missing parameter PACKAGE in $CONF_FILE."
    exit 1
fi
if [ "x$FILES" = "x" ]; then
    cecho $BAD "Missing parameter FILES in $CONF_FILE."
    exit 1
fi

# Check that repository is synchronized
cecho $BOLD "Checking repository..."
HG_INCOMING=`hg incoming | grep changeset | wc -c`
HG_OUTGOING=`hg outgoing | grep changeset | wc -c`
HG_HEADS=`hg heads | grep changeset | wc -l`
if [ "$HG_INCOMING" -ne "0" ]; then
    cecho $BAD "Repository not synchronized, incoming changesets."
    exit 1
fi
if [ "$HG_OUTGOING" -ne "0" ]; then
    cecho $BAD "Repository not synchronized, outgoing changesets."
    exit 1
fi
if [ "$HG_HEADS" -ne "1" ]; then
    cecho $BAD "Multiple heads in repository."
    exit 1
fi
cecho $GOOD "Repository is in good shape. :-)"

# Check buildbot
cecho $BOLD "Checking buildbot status..."
BUILDBOT_BUILDING=`wget -o /dev/null -O- http://fenics.org:8080/ | grep $PACKAGE | grep building | wc -c`
BUILDBOT_FAILED=`wget -o /dev/null -O- http://fenics.org:8080/ | grep $PACKAGE | grep Failed | wc -c`
if [ "$BUILDBOT_BUILDING" -ne "0" ]; then
   cecho $BAD "Buildbot not green, still building."
   exit 1
fi
if [ "$BUILDBOT_FAILED" -ne "0" ]; then
    cecho $BAD "Buildbot not green, build failed on at least one platform."
    exit 1
fi
cecho $GOOD "Buildbot is green. :-)"

# Edit version number in files
cecho $BOLD "Editing version numbers in files..."
sleep 1
for f in $FILES; do
    $EDITOR $f
done
echo "All files edited"

# Get version number
cecho $BOLD "Extracting version number..."
if [ -f $CONF_FILE ]; then
    VERSION=`head -1 ChangeLog | cut -d' ' -f1`
else
    cecho $BAD "Missing ChangeLog file, unable to extract version number."
    exit 1
fi
echo "Version number is $VERSION"

# Tag repository
cecho $BOLD "Tagging repository with version number..."
hg tag $VERSION
echo "Repository tagged with version $VERSION"

# Commit and push changes
cecho $BOLD "Pushing changes to fenics.org..."
hg commit
hg push ssh://$PACKAGE@xxxxxxxxxx/hg/$PACKAGE
echo "Changes pushed to fenics.org"

# Create archive
cecho $BOLD "Creating release tarball..."
ARCHIVE="release/$PACKAGE-$VERSION.tar.gz"
mkdir -p release
hg archive -t tgz --exclude sandbox $ARCHIVE
echo "Release tarball created in $ARCHIVE"

# Copy archive to web server
cecho $BOLD "Copying files to fenics.org..."
REMOTE="www.fenics.org/pub/software/$PACKAGE/"
scp $ARCHIVE fenics@xxxxxxxxxx:$REMOTE
scp ChangeLog fenics@xxxxxxxxxx:$REMOTE

# Notify mailing lists
cecho $BOLD "Notifying mailing lists..."
SUBJECT="Version $VERSION of $PACKAGE released"
LISTS="$PACKAGE-dev@xxxxxxxxxx fenics-dev@xxxxxxxxxx dolfin-users@xxxxxxxxxx"
for LIST in $LISTS; do
    cat ChangeLog | mail -s "$SUBJECT" $LIST
    echo "Mail sent to $LIST"
done

# Update news on fenics.org
cecho $BOLD "Updating news on fenics.org..."
ssh -t fenics@xxxxxxxxxx '/home/fenics/local/bin/news'
echo "News edited"

# Edit download link
cecho $BOLD "Editing download link..."
firefox http://www.fenics.org/w/index.php?title=Download&action=edit&section=4
echo "Download link opened in web browser"

# Update launchpad
cecho $BOLD "Update launchpad"
echo "Launchpad link opened in web browser"
firefox https://launchpad.net/$PACKAGE
echo "Remember to mark milestone as released and change bug status from committed to released"

# Do package-specific post-release tasks
cecho $BOLD "Running package-specific post-release tasks..."
post-release
cecho $GOOD "Done!"

Attachment: signature.asc
Description: Digital signature


References