view garcon/pypi.py @ 656:dba53f0f7671

admin: run an asset processing loop in the background.
author Ludovic Chabant <ludovic@chabant.com>
date Mon, 22 Feb 2016 22:44:39 -0800
parents 1e543ed2bf38
children a04288f199a5
line wrap: on
line source

from invoke import task, run


@task
def makerelease(version, local_only=False):
    if not version:
        raise Exception("You must specify a version!")

    # FoodTruck assets.
    print("Update node modules")
    run("npm install")
    print("Install Bower components")
    run("bower install")
    print("Generating FoodTruck assets")
    run("gulp")

    # CHANGELOG.rst
    run("invoke changelog --last %s" % version)

    if not local_only:
        # Submit the CHANGELOG.
        run('hg commit CHANGELOG.rst -m "cm: Regenerate the CHANGELOG."')

        # Tag in Mercurial, which will then be used for PyPi version.
        run("hg tag %s" % version)

        # PyPi upload.
        run("python setup.py sdist upload")