Esempio n. 1
0
def exists(configuration, env, branch):
    # Init Fabric
    fabric_initer(configuration, env)

    # Params
    branch_slug = utils.slugify(branch)
    domain_path = utils.get_workspace_path(configuration, env, branch)

    #Load configuration
    if api.env.role == "local":
        return False

    else:
        return ffiles.exists(workspace_path + "/" + branch_slug)
Esempio n. 2
0
def exists(configuration, env, branch):
    # Init Fabric
    fabric_initer(configuration, env)

    # Params
    branch_slug = utils.slugify(branch)
    domain_path = utils.get_workspace_path(configuration, env, branch)

    #Load configuration
    if api.env.role == "local":
        return False

    else:
        return ffiles.exists(workspace_path + "/" + branch_slug)
Esempio n. 3
0
def clone(configuration, env, branch):

    #
    fabric_initer(configuration, env)

    #
    branch_slug = utils.slugify(branch)
    workspace_path = utils.get_workspace_path(configuration, env, branch)

    if api.env.role == "local":
        return False

    else:
        with api.cd(workspace_path):
            api.run("git clone --depth 1 %s -b %s ." % (configuration["project"]["repository"], branch))
            return True
Esempio n. 4
0
def pull(configuration, env, branch="develop"):

    #
    fabric_initer(configuration, env)

    #
    branch_slug = utils.slugify(branch)
    workspace_path = utils.get_workspace_path(configuration, env, branch)

    if api.env.role == "local":
        api.local("git pull origin %s" % branch)
        return True

    else:
        with api.cd(workspace_path):
            api.run("git pull origin %s" % branch)
            return True
Esempio n. 5
0
def bake(configuration, recipes, env, branch="develop"):
    """
    Bake
    branch

    Bake
    """

    # Init Fabric
    fabric_initer(configuration, env)

    # Params
    branch_slug = utils.slugify(branch)
    workspace_path = utils.get_workspace_path(configuration, env, branch)

    if install(configuration, recipes, env, branch):
        return True

    return False
Esempio n. 6
0
def bake(configuration, recipes, env, branch="develop"):
    """
    Bake
    branch

    Bake
    """

    # Init Fabric
    fabric_initer(configuration, env)

    # Params
    branch_slug = utils.slugify(branch)
    workspace_path = utils.get_workspace_path(configuration, env, branch)

    if install(configuration, recipes, env, branch):
        return True

    return False
Esempio n. 7
0
def post_install(configuration, recipes, env, branch):
    # Init Fabric
    fabric_initer(configuration, env)

    # Params
    branch_slug = utils.slugify(branch)
    workspace_path = utils.get_workspace_path(configuration, env, branch)

    if api.env.role == "local":
        return False

    else:
        with api.cd(workspace_path):
            recipe_type = configuration[env]["app"]["type"]

            pprint.pprint(recipe_type)
            pprint.pprint(recipes)
            recipe_post_install = None

            api.run("sh %s" % recipe_post_install)
Esempio n. 8
0
def post_install(configuration, recipes, env, branch):
    # Init Fabric
    fabric_initer(configuration, env)

    # Params
    branch_slug = utils.slugify(branch)
    workspace_path = utils.get_workspace_path(configuration, env, branch)

    if api.env.role == "local":
        return False

    else:
        with api.cd(workspace_path):
            recipe_type = configuration[env]["app"]["type"]

            pprint.pprint(recipe_type)
            pprint.pprint(recipes)
            recipe_post_install = None

            api.run("sh %s" % recipe_post_install)
Esempio n. 9
0
def exists(configuration, env, branch="develop"):
    """
    Repository exists
    branch

    Test repository existence
    """

    # Init Fabric
    fabric_initer(configuration, env)

    # Params
    branch_slug = utils.slugify(branch)
    workspace_path = utils.get_workspace_path(configuration, env, branch)

    if api.env.role == "local":
        return False

    else:
        if not workspace_path:
            return False
        else:
            return ffiles.exists(workspace_path + "/.git")