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(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()
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() _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]) 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( app_config.S3_BUCKET, 'www', '%s%s' % (app_config.DEBATE_DIRECTORY_PREFIX, app_config.CURRENT_DEBATE), 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.DEBATE_DIRECTORY_PREFIX, app_config.CURRENT_DEBATE), 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()
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()
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(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 })
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_SERVICES: servers.deploy_confs()
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_server(remote='origin'): """ Deploy and restart server """ 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_copytext') servers.fabcast('text.update_active_docs') servers.fabcast('text.update_calendar') servers.fabcast('assets.sync') if app_config.DEPLOY_CRONTAB: servers.install_crontab() if app_config.DEPLOY_SERVICES: servers.deploy_confs()