def deploy_nginx(): require('site', 'upstream', 'available', 'ssl_cert', 'ssl_key', provided_by=('prod', 'staging', 'dev')) render_to_file('deployment/nginx_conf_template', 'nginx_conf', server_name=env['site'], ssl_cert=env['ssl_cert'], ssl_key=env['ssl_key'], upstream=env['upstream']) put('nginx_conf', pjoin('/etc/nginx/sites-available/', env['available']), use_sudo=True) nginx.enabled(env['available']) nginx.disabled('default')
def deploy_nginx(): frequire('SERVER_NAME', provided_by=('vagrant',)) upload_template('site.conf.j2', '/etc/nginx/sites-available/%s' % SITE_NAME, context={ 'nginx_server_name': env['SERVER_NAME'], 'site_dir': SITE_DIR, 'static_dir': join(SITE_DIR, 'site_media', 'static'), 'static_parent_dir': join(SITE_DIR, 'site_media'), 'gunicorn_port': '8001', }, template_dir=TEMPLATE_DIR, use_jinja=True, use_sudo=True, ) nginx.enabled(SITE_NAME) nginx.disabled('default')
def deploy_nginx(): frequire('SERVER_NAME', provided_by=('vagrant', )) upload_template( 'site.conf.j2', '/etc/nginx/sites-available/%s' % SITE_NAME, context={ 'nginx_server_name': env['SERVER_NAME'], 'site_dir': SITE_DIR, 'static_dir': join(SITE_DIR, 'site_media', 'static'), 'static_parent_dir': join(SITE_DIR, 'site_media'), 'gunicorn_port': '8001', }, template_dir=TEMPLATE_DIR, use_jinja=True, use_sudo=True, ) nginx.enabled(SITE_NAME) nginx.disabled('default')
def deploy_nginx(): """ ensure that nginx is installed and our site is enabled """ require('managed', 'server_name') nginx.server() upload_template( 'seattle2015-site.conf.j2', '/etc/nginx/sites-available/seattle2015.conf', context={ 'server_name': env.server_name, 'managed': env.managed, }, use_jinja=True, use_sudo=True, template_dir=env.deploy_dir, ) nginx.enabled('seattle2015.conf') nginx.disabled('default') restart_nginx()
def deploy_nginx(): require('site', 'upstream', 'available', 'ssl_cert', 'ssl_key', provided_by=('prod', 'staging', 'dev')) render_to_file('deployment/nginx_conf_template', 'nginx_conf', server_name=env['site'], rewrite_name=env['rewrite_name'], ssl_cert=env['ssl_cert'], ssl_key=env['ssl_key'], upstream=env['upstream']) put('nginx_conf', pjoin('/etc/nginx/sites-available/', env['available']), use_sudo=True) nginx.enabled(env['available']) nginx.disabled('default')