Exemple #1
0
def deploy(remote='origin'):
    """
    Deploy the latest app to S3 and, if configured, to our servers.
    """
    require('settings', provided_by=[production, staging])

    if app_config.DEPLOY_TO_SERVERS:
        require('branch', provided_by=[stable, master, branch])

        if (app_config.DEPLOYMENT_TARGET == 'production'
                and env.branch != 'stable'):
            utils.confirm(
                colored(
                    "You are trying to deploy the '%s' branch to production.\nYou should really only deploy a stable branch.\nDo you know what you're doing?"
                    % env.branch, "red"))

        servers.checkout_latest(remote)

        servers.fabcast('text.update')
        #servers.fabcast('assets.sync')
        servers.fabcast('data.update')

        if app_config.DEPLOY_CRONTAB:
            # servers.install_crontab()
            _servers.install_crontab()

        if app_config.DEPLOY_SERVICES:
            servers.deploy_confs()

    update()
    render.render_all()

    _deploy_to_graphics()
def deploy(remote='origin'):
    """
    Deploy the latest app to S3 and, if configured, to our servers.
    """
    require('settings', provided_by=[production, staging])

    if app_config.DEPLOY_TO_SERVERS:
        require('branch', provided_by=[stable, master, branch])

        if (app_config.DEPLOYMENT_TARGET == 'production' and env.branch != 'stable'):
            utils.confirm(
                colored("You are trying to deploy the '%s' branch to production.\nYou should really only deploy a stable branch.\nDo you know what you're doing?" % env.branch, "red")
            )

        servers.checkout_latest(remote)

        servers.fabcast('text.update')
        #servers.fabcast('assets.sync')
        servers.fabcast('data.update')

        if app_config.DEPLOY_CRONTAB:
            # servers.install_crontab()
            _servers.install_crontab()

        if app_config.DEPLOY_SERVICES:
            servers.deploy_confs()

    update()
    render.render_all()

    _deploy_to_graphics()
Exemple #3
0
def reset_server():
    require('settings', provided_by=['production', 'staging'])
    require('branch', provided_by=['master', 'stable'])

    with settings(warn_only=True):
        servers.stop_service('deploy_liveblog')
        servers.stop_service('deploy_results')
        servers.stop_service('uwsgi')
    servers.fabcast('ap.init ap.clear_calls data.bootstrap liveblog.update')
    servers.start_service('uwsgi')
    servers.start_service('deploy_liveblog')
    servers.start_service('deploy_results')
Exemple #4
0
def reset_server():
    require('settings', provided_by=['production', 'staging'])
    require('branch', provided_by=['master', 'stable'])

    with settings(warn_only=True):
        servers.stop_service('deploy_liveblog')
        servers.stop_service('deploy_results')
        servers.stop_service('uwsgi')
    servers.fabcast('ap.init ap.clear_calls data.bootstrap liveblog.update')
    servers.start_service('uwsgi')
    servers.start_service('deploy_liveblog')
    servers.start_service('deploy_results')
Exemple #5
0
def deploy(remote='origin'):
    """
    Deploy the latest app to S3 and, if configured, to our servers.
    """
    require('settings', provided_by=[production, staging])

    if app_config.DEPLOY_TO_SERVERS:
        require('branch', provided_by=[stable, master, branch])

        if (app_config.DEPLOYMENT_TARGET == 'production'
                and env.branch != 'stable'):
            utils.confirm(
                colored(
                    "You are trying to deploy the '%s' branch to production.\nYou should really only deploy a stable branch.\nDo you know what you're doing?"
                    % env.branch, "red"))

        servers.checkout_latest(remote)

        servers.fabcast('text.update')
        #servers.fabcast('assets.sync')
        servers.fabcast('data.update')

        if app_config.DEPLOY_CRONTAB:
            # servers.install_crontab()
            _servers.install_crontab()

        if app_config.DEPLOY_SERVICES:
            servers.deploy_confs()

    update()
    render.render_all()

    # # Clear files that should never be deployed
    # local('rm -rf www/live-data')

    # flat.deploy_folder(
    #     'www',
    #     app_config.PROJECT_SLUG,
    #     headers={
    #         'Cache-Control': 'max-age=%i' % app_config.DEFAULT_MAX_AGE
    #     },
    #     ignore=['www/assets/*', 'www/live-data/*']
    # )

    # flat.deploy_folder(
    #     'www/assets',
    #     '%s/assets' % app_config.PROJECT_SLUG,
    #     headers={
    #         'Cache-Control': 'max-age=%i' % app_config.ASSETS_MAX_AGE
    #     }
    # )
    _deploy_to_graphics()
def deploy(remote='origin'):
    """
    Deploy the latest app to S3 and, if configured, to our servers.
    """
    require('settings', provided_by=[production, staging])

    if app_config.DEPLOY_TO_SERVERS:
        require('branch', provided_by=[stable, master, branch])

        if (app_config.DEPLOYMENT_TARGET == 'production' and env.branch != 'stable'):
            utils.confirm(
                colored("You are trying to deploy the '%s' branch to production.\nYou should really only deploy a stable branch.\nDo you know what you're doing?" % env.branch, "red")
            )

        servers.checkout_latest(remote)

        servers.fabcast('text.update')
        #servers.fabcast('assets.sync')
        servers.fabcast('data.update')

        if app_config.DEPLOY_CRONTAB:
            # servers.install_crontab()
            _servers.install_crontab()

        if app_config.DEPLOY_SERVICES:
            servers.deploy_confs()

    update()
    compiled_includes = render.render_all()
    render.render_restaurants(compiled_includes)

    # # Clear files that should never be deployed
    # local('rm -rf www/live-data')

    # flat.deploy_folder(
    #     'www',
    #     app_config.PROJECT_SLUG,
    #     headers={
    #         'Cache-Control': 'max-age=%i' % app_config.DEFAULT_MAX_AGE
    #     },
    #     ignore=['www/assets/*', 'www/live-data/*']
    # )

    # flat.deploy_folder(
    #     'www/assets',
    #     '%s/assets' % app_config.PROJECT_SLUG,
    #     headers={
    #         'Cache-Control': 'max-age=%i' % app_config.ASSETS_MAX_AGE
    #     }
    # )
    _deploy_to_graphics()
Exemple #7
0
def deploy(analyse=True, remote='origin'):
    """
    Deploy the latest app to S3 and, if configured, to our servers.
    """
    require('settings', provided_by=[production, staging])

    if app_config.DEPLOY_TO_SERVERS:
        require('branch', provided_by=[stable, master, branch])

        if (app_config.DEPLOYMENT_TARGET == 'production'
                and env.branch != 'stable'):
            utils.confirm(
                colored(
                    "You are trying to deploy the '%s' branch to production.\nYou should really only deploy a stable branch.\nDo you know what you're doing?"
                    % env.branch, "red"))

        servers.checkout_latest(remote)

        servers.fabcast('text.update')
        servers.fabcast('assets.sync')

        if app_config.DEPLOY_CRONTAB:
            servers.install_crontab()

        if app_config.DEPLOY_SERVICES:
            servers.deploy_confs()

    if analyse == True:
        execute('analysis.analyse')
        execute('render.render_all')

        flat.deploy_folder(app_config.S3_BUCKET['bucket_name'],
                           'www',
                           app_config.PROJECT_SLUG,
                           headers={
                               'Cache-Control':
                               'max-age=%i' % app_config.DEFAULT_MAX_AGE
                           },
                           ignore=['www/assets/*'])

        flat.deploy_folder(app_config.S3_BUCKET['bucket_name'],
                           'www/assets',
                           '%s/assets' % app_config.PROJECT_SLUG,
                           headers={
                               'Cache-Control':
                               'max-age=%i' % app_config.ASSETS_MAX_AGE
                           })
Exemple #8
0
def deploy(remote='origin'):
    """
    Deploy the latest app to S3 and, if configured, to our servers.
    """
    require('settings', provided_by=[production, staging])

    if app_config.DEPLOY_TO_SERVERS:
        require('branch', provided_by=[stable, master, branch])

        if (app_config.DEPLOYMENT_TARGET == 'production' and env.branch != 'stable'):
            utils.confirm("You are trying to deploy the '%s' branch to production.\nYou should really only deploy a stable branch.\nDo you know what you're doing?" % env.branch)

        servers.checkout_latest(remote)

        servers.fabcast('copytext.update')
        servers.fabcast('assets.sync')
        servers.fabcast('data.update')

        if app_config.DEPLOY_CRONTAB:
            servers.install_crontab()

        if app_config.DEPLOY_SERVICES:
            servers.deploy_confs()

    # update()
    compiled_includes = render.render_all()
    render.render_stories(compiled_includes)
    _gzip('www', '.gzip')
    _deploy_to_s3()
    _gzip('.stories_html', '.stories_gzip')
    _deploy_to_s3('.stories_gzip')
Exemple #9
0
def deploy(quick=None, remote='origin', reload=False):
    """
    Deploy the latest app to S3 and, if configured, to our servers.
    """
    require('settings', provided_by=[random_prod, production, staging])

    if app_config.DEPLOYMENT_TARGET == 'production' or app_config.DEPLOYMENT_TARGET == 'random_prod':
        utils.confirm(
            colored(
                "You are trying to deploy to production this project %s.\nDo you know what you're doing?"
                % app_config.PROJECT_SLUG, "red"))

    if app_config.DEPLOY_TO_SERVERS:
        require('branch', provided_by=[stable, master, branch])

        if (app_config.DEPLOYMENT_TARGET == 'production'
                and env.branch != 'stable'):
            utils.confirm(
                colored(
                    "You are trying to deploy the '%s' branch to production.\nYou should really only deploy a stable branch.\nDo you know what you're doing?"
                    % env.branch, "red"))

        servers.checkout_latest(remote)

        servers.fabcast('text.update')
        servers.fabcast('data.update')
        servers.fabcast('assets.sync')

        if app_config.DEPLOY_CRONTAB:
            servers.install_crontab()

        if app_config.DEPLOY_SERVICES:
            servers.deploy_confs()

    if quick != 'quick':
        update()

    render.render_all()

    # Clear files that should never be deployed
    local('rm -rf www/live-data')

    flat.deploy_folder(
        app_config.S3_BUCKET,
        'www',
        app_config.PROJECT_SLUG,
        headers={'Cache-Control': 'max-age=%i' % app_config.DEFAULT_MAX_AGE},
        ignore=['www/assets/*', 'www/live-data/*'])

    flat.deploy_folder(
        app_config.S3_BUCKET,
        'www/assets',
        '%s/assets' % app_config.PROJECT_SLUG,
        headers={'Cache-Control': 'max-age=%i' % app_config.ASSETS_MAX_AGE})

    if reload:
        reset_browsers()

    if not check_timestamp():
        reset_browsers()
Exemple #10
0
def deploy_server(remote='origin'):
    """
    Deploy server code and configuration.
    """
    if app_config.DEPLOY_TO_SERVERS:
        require('branch', provided_by=[stable, master, branch])

        if (app_config.DEPLOYMENT_TARGET == 'production' and env.branch != 'stable'):
            utils.confirm(
                colored("You are trying to deploy the '%s' branch to production.\nYou should really only deploy a stable branch.\nDo you know what you're doing?" % env.branch, "red")
            )

        servers.checkout_latest(remote)

        servers.fabcast('text.update')
        servers.fabcast('assets.sync')

        if app_config.DEPLOY_CRONTAB:
            servers.install_crontab()

        if app_config.DEPLOY_SERVICES:
            servers.deploy_confs()
Exemple #11
0
def deploy(quick=None, remote='origin', reload=False):
    """
    Deploy the latest app to S3 and, if configured, to our servers.
    """
    require('settings', provided_by=[production, staging])

    if app_config.DEPLOY_TO_SERVERS:
        require('branch', provided_by=[stable, master, branch])

        if (app_config.DEPLOYMENT_TARGET == 'production' and env.branch != 'stable'):
            utils.confirm(
                colored("You are trying to deploy the '%s' branch to production.\nYou should really only deploy a stable branch.\nDo you know what you're doing?" % env.branch, "red")
            )

        servers.checkout_latest(remote)

        servers.fabcast('text.update')
        servers.fabcast('assets.sync')
        servers.fabcast('data.update')

        if app_config.DEPLOY_CRONTAB:
            servers.install_crontab()

        if app_config.DEPLOY_SERVICES:
            servers.deploy_confs()

    if quick != 'quick':
        update()

    render.render_all()

    # Clear files that should never be deployed
    local('rm -rf www/live-data')

    flat.deploy_folder(
        app_config.S3_BUCKET,
        'www',
        app_config.PROJECT_SLUG,
        headers={
            'Cache-Control': 'max-age=%i' % app_config.DEFAULT_MAX_AGE
        },
        ignore=['www/assets/*', 'www/live-data/*']
    )

    flat.deploy_folder(
        app_config.S3_BUCKET,
        'www/assets',
        '%s/assets' % app_config.PROJECT_SLUG,
        headers={
            'Cache-Control': 'max-age=%i' % app_config.ASSETS_MAX_AGE
        }
    )

    if reload:
        reset_browsers()

    if not check_timestamp():
        reset_browsers()
Exemple #12
0
def deploy_server(remote='origin'):
    """
    Deploy server code and configuration.
    """
    if app_config.DEPLOY_TO_SERVERS:
        require('branch', provided_by=[stable, master, branch])

        if (app_config.DEPLOYMENT_TARGET == 'production'
                and env.branch != 'stable'):
            utils.confirm(
                colored(
                    "You are trying to deploy the '%s' branch to production.\nYou should really only deploy a stable branch.\nDo you know what you're doing?"
                    % env.branch, "red"))

        servers.checkout_latest(remote)

        servers.fabcast('text.update')
        servers.fabcast('assets.sync')

        if app_config.DEPLOY_CRONTAB:
            servers.install_crontab()

        if app_config.DEPLOY_SERVICES:
            servers.deploy_confs()
def deploy(remote='origin'):
    """
    Deploy the latest app to S3 and, if configured, to our servers.
    """
    require('settings', provided_by=[production, staging])

    if app_config.DEPLOY_TO_SERVERS:
        require('branch', provided_by=[stable, master, branch])

        if (app_config.DEPLOYMENT_TARGET == 'production' and env.branch != 'stable'):
            utils.confirm(
                colored("You are trying to deploy the '%s' branch to production.\nYou should really only deploy a stable branch.\nDo you know what you're doing?" % env.branch, "red")
            )

        servers.checkout_latest(remote)

        servers.fabcast('text.update')
        servers.fabcast('assets.sync')
        servers.fabcast('data.update')

        if app_config.DEPLOY_CRONTAB:
            servers.install_crontab()

        if app_config.DEPLOY_SERVICES:
            servers.deploy_confs()

    update()
    render.render_all()

    # Clear files that should never be deployed
    local('rm -rf www/live-data')

    flat.deploy_folder(
        'www',
        app_config.PROJECT_SLUG,
        max_age=app_config.DEFAULT_MAX_AGE,
        ignore=['www/assets/*']
    )

    flat.deploy_folder(
        '.briefings_html',
        app_config.PROJECT_SLUG,
        max_age=app_config.DEFAULT_MAX_AGE,
    )

    flat.deploy_folder(
        'www/assets',
        '%s/assets' % app_config.PROJECT_SLUG,
        max_age=app_config.ASSETS_MAX_AGE
    )
def deploy(remote="origin"):
    """
    Deploy the latest app to S3 and, if configured, to our servers.
    """
    require("settings", provided_by=[production, staging])

    if app_config.DEPLOY_TO_SERVERS:
        require("branch", provided_by=[stable, master, branch])

        if app_config.DEPLOYMENT_TARGET == "production" and env.branch != "stable":
            utils.confirm(
                colored(
                    "You are trying to deploy the '%s' branch to production.\nYou should really only deploy a stable branch.\nDo you know what you're doing?"
                    % env.branch,
                    "red",
                )
            )

        servers.checkout_latest(remote)

        servers.fabcast("text.update")
        servers.fabcast("assets.sync")
        servers.fabcast("data.update")

        if app_config.DEPLOY_CRONTAB:
            servers.install_crontab()

        if app_config.DEPLOY_SERVICES:
            servers.deploy_confs()

    update()
    render.render_all()

    # Clear files that should never be deployed
    local("rm -rf www/live-data")

    flat.deploy_folder(
        "www",
        app_config.PROJECT_SLUG,
        headers={"Cache-Control": "max-age=%i" % app_config.DEFAULT_MAX_AGE},
        ignore=["www/assets/*", "www/live-data/*"],
    )

    flat.deploy_folder(
        "www/assets",
        "%s/assets" % app_config.PROJECT_SLUG,
        headers={"Cache-Control": "max-age=%i" % app_config.ASSETS_MAX_AGE},
    )
Exemple #15
0
def deploy(remote='origin', reload=False):
    """
    Deploy the latest app to S3 and, if configured, to our servers.
    """
    require('settings', provided_by=[production, staging])

    if app_config.DEPLOY_TO_SERVERS:
        require('branch', provided_by=[stable, master, branch])

        if (app_config.DEPLOYMENT_TARGET == 'production'
                and env.branch != 'stable'):
            utils.confirm(
                colored(
                    "You are trying to deploy the '%s' branch to production.\nYou should really only deploy a stable branch.\nDo you know what you're doing?"
                    % env.branch, "red"))

        servers.checkout_latest(remote)

        # servers.fabcast('text.update')
        # servers.fabcast('assets.sync')
        # servers.fabcast('data.update')

        if app_config.DEPLOY_CRONTAB:
            servers.install_crontab()

        if app_config.DEPLOY_SERVICES:
            servers.deploy_confs()

        servers.fabcast('servers.install_requirements')

        # add factcast for the authors dictionary
        servers.fabcast('text.update')

    update()
    render.render_all()

    # Clear files that should never be deployed
    local('rm -rf www/live-data')

    flat.deploy_folder(
        app_config.S3_BUCKET,
        'www',
        '%s%s' %
        (app_config.LIVEBLOG_DIRECTORY_PREFIX, app_config.CURRENT_LIVEBLOG),
        headers={'Cache-Control': 'max-age=%i' % app_config.DEFAULT_MAX_AGE},
        ignore=['www/assets/*', 'www/live-data/*'])

    flat.deploy_folder(
        app_config.S3_BUCKET,
        'www/assets',
        '%s%s/assets' %
        (app_config.LIVEBLOG_DIRECTORY_PREFIX, app_config.CURRENT_LIVEBLOG),
        headers={'Cache-Control': 'max-age=%i' % app_config.ASSETS_MAX_AGE})

    # DEPLOY STATIC LIVEBLOG FROM LOCAL ENVIRONMENT
    if app_config.DEPLOY_STATIC_LIVEBLOG:
        execute('deploy_liveblog')

    if reload:
        reset_browsers()

    if not check_timestamp():
        reset_browsers()
Exemple #16
0
def deploy(remote='origin'):
    """
    Deploy and restart services
    """
    deploy_server(remote)
    servers.fabcast('deploy_client')