Exemplo n.º 1
0
def deploy_eggs():
    """deploy eggs to server"""
    print "deploying version: " + yellow(env.package_version)

    print green("deploying code packages ...")
    dest = "%(WT_HOME)s/codebase/WEB-INF" % os.environ
    for package, egg in eggs():
        local("cp src/%s/dist/%s %s/lib-python/%s" % (package, egg_for_customer(egg), dest, egg))
        print yellow("deployed %s -> %s" % (egg_for_customer(egg), egg))

    print green("done.")
Exemplo n.º 2
0
def dist(version=None, customer=None):
    """create a dist package on the nexiles dist server"""
    if customer:
        customer_list = [customer]
    else:
        customer_list = env.customer_list.split()

    setup_version(ask=True)
    print "Creating dist packages for version: " + yellow(env.package_version)

    dist_docs()

    print "dist for "
    for customer in customer_list:
        env.customer = customer
        print red(env.customer), " "
        dist_eggs()
    print "done."

    if "additional_packages" in env:
        for p in env.additional_packages:
            print red("deploying additional package: " + p)
            dist_package(p, versionize=True)

    env.service_name = env.projectname.split(".")[-1]
    dist_package("%(build_dir)s/%(service_name)s-windows.pth" % env)
    dist_package("%(build_dir)s/%(service_name)s-unix.pth" % env)

    with file("%(dist_dir)s/%(service_name)ssite.xconf" % env, "w") as xconf:
        print >>xconf, """<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configuration SYSTEM "xconf.dtd">
<Configuration xmlns:xlink="http://www.w3.org/1999/xlink">
    <Property name="nexiles.gateway.plugins" overridable="true" targetFile="codebase/wt.properties" value="%(projectname)s"/>
</Configuration>
""" % env

    print
    print
    print "customers dist'd : ", red(customer_list)
    print "version          : ", red(env.package_version)
    print "code packages    : ", red(" ".join([egg_for_customer(egg) for package, egg in eggs()]))
    print "additional pkgs  : ", red(" ".join(env.get("additional_packages", [])))
    print "doc  packages    : ", red(env.doc_package)
    print "dist dir         : ", red(env.dist_dir)
Exemplo n.º 3
0
def build_eggs(customer="nexiles"):
    """build package egges"""
    for package, egg in eggs():
        print yellow("building egg for %s" % package)
        with lcd("src/"+ package):

            # mark package for customer
            marked, license_py = mark_package()

            with settings(hide("stdout")):
                local("nxjython --wt setup.py bdist_egg --exclude-source")

            # revert changes in license_py if marked
            if marked:
                print red("reverting changes to %s" % license_py)
                local("git checkout %s" % license_py)

            # add manifest
            mf = make_manifest_file(package, egg)

            resources = package.split(".") + ["resources",]
            resources = os.path.join(*resources)

            if not os.path.exists(os.path.join(env.lcwd, resources)):
                print red("resources dir missing: ") + yellow(resources)
                print red("creating resources dir for package: ") + yellow(package)
                local("mkdir -p %s" % resources)

            # copy manifest file
            local("cp %s %s/manifest.json" % (mf, resources))

            # package resources
            local("zip -ur dist/%s %s" % (egg, resources))

            # rename egg with customer name
            local("mv dist/%s dist/%s" %(egg, egg_for_customer(egg)))
Exemplo n.º 4
0
def dist_eggs():
    # copy stuff
    for package, egg in eggs():
        local("cp src/%s/dist/%s %s" % (package, egg_for_customer(egg), env.dist_dir))
        print yellow("disted %s" % egg_for_customer(egg))