Exemple #1
0
def relink(publish_git_tag, env_string):
    service = DeployByEnvService(env_string)
    remote_root_path = service.get('REMOTE_PROJECT_ROOT_PATH')
    project_name = service.get('PROJECT_NAME')
    remote_deployment_root_path = service.get('REMOTE_PROJECT_DEPLOYMENT_ROOT_PATH')
    remote_deployment_path = os.path.join(remote_deployment_root_path, project_name)
    remote_deployment_path = os.path.join(remote_deployment_path, '%s_%s' % (project_name, publish_git_tag))
    remote_deployment_path = remote_deployment_path.replace('\\', '/')
    with cd(remote_root_path):
        run('rm -rf %s' % project_name)
        run('ln -s %s %s' % (remote_deployment_path, project_name))
Exemple #2
0
def deploy(publish_git_tag, env_string):
    """
    Deploy package to remote
    :return:
    """
    service = DeployByEnvService(env_string)
    tar_file_name, tar_file_path = service.get_package(build_version=publish_git_tag)
    remote_deployment_root_path = service.get('REMOTE_PROJECT_DEPLOYMENT_ROOT_PATH')
    project_name = service.get('PROJECT_NAME')
    remote_deployment_path = os.path.join(remote_deployment_root_path, project_name)
    remote_deployment_path = remote_deployment_path.replace('\\', '/')
    with cd(remote_deployment_path):
        put(tar_file_path, remote_deployment_path)
        run('tar zvxf ./%s' % tar_file_name)