Beispiel #1
0
def deploy(version):
    """ For docs, see https://github.com/pkimber/cloud_docs """
    env.user = '******'
    folder_info = FolderInfo(env.site_info, version)
    # validate
    if exists(folder_info.install()):
        raise Exception(
            'Install folder {} already exists'.format(folder_info.install())
        )
    print(green(folder_info.install()))
    # create folders
    if not exists(folder_info.deploy()):
        run('mkdir {}'.format(folder_info.deploy()))
    run('mkdir {}'.format(folder_info.install()))
    run('mkdir {}'.format(folder_info.install_temp()))
    if env.site_info.is_php:
        deploy_php(folder_info, env.site_info)
    else:
        deploy_django(folder_info, env.site_info, version)
    # symbolic link
    link_install_to_live_folder(folder_info.install(), folder_info.live())
    if env.site_info.is_django():
        django_post_deploy(folder_info)
    # Post deploy
    run_post_deploy_test(env.site_info)
Beispiel #2
0
def ok():
    """
    Test a live site (automatically done at the end of a deploy)

    e.g:
    fab -f deploy.py ok:name=csw_web
    """
    run_post_deploy_test(env.site_info)