#!/usr/bin/env python
import os

# Increase version number.

# Build and upload provide scripts for new version.

# Make list of changes.

# Pass developer tests.

# Commit changes.

# Update changes.

# Pass developer tests.

# Pass integration tests.

# Create distribution.
os.system("rm -fv `find . -name '*.pyc'`")
os.system("rm -fv MANIFEST")
os.system("python setup.py sdist")

print "Copying distribution to download location..."
import sys
sys.path.append('./src')
from dm import __version__
cmd = "scp dist/domainmodel-%s.tar.gz appropriatesoftware.net:awf/system/domains/AppropriateSoftwareFoundation.org/provide/docs" % __version__
print cmd
os.system(cmd)

print "Committing release product..."
cmd = "svn add dist dist/domainmodel-%s.tar.gz" % __version__
print cmd
if os.system(cmd):
    sys.exit(1)
cmd = "svn ci dist/domainmodel-%s.tar.gz -m\"Created new distribution for domainmodel %s\"" % (__version__, __version__)
print cmd
if os.system(cmd):
    sys.exit(1)


# Further manual steps. 
print "Update domainmodel website to state and point to new release."
print "Update cheeseshop."
print "Post notices (where?)."
print "Increase version number."


