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() render.render_all() _gzip('www', '.gzip') _deploy_to_s3()
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) if app_config.DEPLOY_CRONTAB: servers.install_crontab() if app_config.DEPLOY_SERVICES: servers.deploy_confs() update() render.render_all() flat.deploy_folder( app_config.S3_BUCKET, 'www', app_config.PROJECT_SLUG, headers={ 'Cache-Control': 'max-age=%i' % app_config.DEFAULT_MAX_AGE }, ignore=[] )
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()
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]) servers.checkout_latest(remote) if app_config.DEPLOY_CRONTAB: servers.install_crontab()
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}, )
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', 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]) # disabled this check since we deploy from configuration branches now - TW if (False and 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() # 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.FACTCHECKS_DIRECTORY_PREFIX, app_config.CURRENT_FACTCHECK), 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.FACTCHECKS_DIRECTORY_PREFIX, app_config.CURRENT_FACTCHECK), headers={'Cache-Control': 'max-age=%i' % app_config.ASSETS_MAX_AGE}) # DEPLOY STATIC FACTCHECK FROM LOCAL ENVIRONMENT if app_config.DEPLOY_STATIC_FACTCHECK: execute('deploy_factcheck') if reload: reset_browsers() if not check_timestamp(): reset_browsers()