Exemple #1
0
def deploy(revision=None, code_only=False, sync_media=True):
    "Deploy a revision to server"
    if revision:
        env.revision = revision
        env.sha = query_revision(revision)
    require("deploy_to", "hosts", "environment")
    enable_maintenance_page()
    code_deploy()
    if not _truth_value(code_only):
        install_requirements()
        optimize_static()
        if _truth_value(sync_media):
            s3sync()
        syncdb()
        migratedb()
    restart_app_server()
    disable_maintenance_page()
    print(green("%(revision)s has been deployed to %(environment)s" % env))
def deploy(revision=None, code_only=False, sync_media=True):
    "Deploy a revision to server"
    if revision:
        env.revision = revision
        env.sha = query_revision(revision)
    require("deploy_to", "hosts", "environment")
    enable_maintenance_page()
    code_deploy()
    if not _truth_value(code_only):
        install_requirements()
        optimize_static()
        if _truth_value(sync_media):
            s3sync()
        syncdb()
        migratedb()
    restart_app_server()
    disable_maintenance_page()
    codebase_deployment()
    print(green("%(revision)s has been deployed to %(environment)s" % env))
Exemple #3
0
from utils import query_revision

env.user = "******"
env.disable_known_hosts = True

# Roles take a list of one or more servers
env.roledefs = {
    "application": [""],
    "loadbalancer": [""],
    "staging": ["ec2-107-20-218-152.compute-1.amazonaws.com"],
}

env.deploy_to = "/home/%(user)s/webapp" % env
env.parent = "origin"
env.revision = "HEAD"
env.sha = query_revision(env.revision)
env.repository = "git://github.com/350org/localpower.git"

def staging():
    env.roles = ["staging"]
    env.environment = "staging"
    env.loadbalancers = env.roledefs["staging"]

def prod():
    env.roles = ["application"]
    env.environment = "production"
    env.loadbalancers = env.roledefs["loadbalancer"]

def environment(environment):
    env.environment = environment
from utils import query_revision

env.user = "******"
env.disable_known_hosts = True

env.roledefs = {
    "application":
    ["example.compute-1.amazonaws.com", "example2.compute-1.amazonaws.com"],
    "loadbalancer": ["example.com"],
    "staging": ["staging.example.com"],
}

env.deploy_to = "/home/%(user)s/webapp" % env
env.parent = "origin"
env.revision = "HEAD"
env.sha = query_revision(env.revision)
env.repository = "[email protected]:rah/rah/rah.git"


def staging():
    env.roles = ["staging"]
    env.environment = "staging"
    env.loadbalancers = env.roledefs["staging"]


def prod():
    env.roles = ["application"]
    env.environment = "production"
    env.loadbalancers = env.roledefs["loadbalancer"]