got rid of upload_gunicorn from supervisor.py since it is in django.generate:gunicorn
modified: supervisor.py
This commit is contained in:
parent
9d17a91995
commit
cb0eff3c4e
1 changed files with 1 additions and 73 deletions
|
|
@ -8,8 +8,7 @@ import os
|
||||||
from maintenance import command as maintenance_command
|
from maintenance import command as maintenance_command
|
||||||
from maintenance import edit as maintenance_edit
|
from maintenance import edit as maintenance_edit
|
||||||
|
|
||||||
from utils import loggify, print_run
|
from utils import loggify
|
||||||
import logging
|
|
||||||
|
|
||||||
|
|
||||||
def _initialize(configuration):
|
def _initialize(configuration):
|
||||||
|
|
@ -275,77 +274,6 @@ def remove():
|
||||||
sudo(rm_command)
|
sudo(rm_command)
|
||||||
|
|
||||||
|
|
||||||
@task
|
|
||||||
def upload_gunicorn():
|
|
||||||
"""
|
|
||||||
create the gunicorn configuration script
|
|
||||||
put it in the build folder and link it to the scripts directory
|
|
||||||
"""
|
|
||||||
configuration = env.config
|
|
||||||
|
|
||||||
if env.debug:
|
|
||||||
logging.basicConfig(
|
|
||||||
format='\n%(levelname)s: deploy.gunicorn %(message)s',
|
|
||||||
level=logging.DEBUG)
|
|
||||||
|
|
||||||
files_path = os.path.join(
|
|
||||||
configuration.templates.gunicorn.path.local,
|
|
||||||
'files')
|
|
||||||
|
|
||||||
build_path = os.path.join(
|
|
||||||
configuration.templates.gunicorn.path.remote,
|
|
||||||
'build',
|
|
||||||
configuration.templates.gunicorn.conf.dst)
|
|
||||||
|
|
||||||
link_path = os.path.join(
|
|
||||||
configuration.paths.server.scripts,
|
|
||||||
configuration.templates.gunicorn.conf.dst
|
|
||||||
)
|
|
||||||
|
|
||||||
context = dict()
|
|
||||||
|
|
||||||
context['host'] = configuration.server.django.host
|
|
||||||
context['port'] = configuration.server.django.port
|
|
||||||
|
|
||||||
context['user'] = configuration.project.user
|
|
||||||
context['group'] = configuration.project.group
|
|
||||||
|
|
||||||
context['settings_module'] = configuration.imports.settings
|
|
||||||
|
|
||||||
context['logging_access'] = configuration.logging.gunicorn.access
|
|
||||||
context['logging_error'] = configuration.logging.gunicorn.error
|
|
||||||
|
|
||||||
msg_link_gunicorn = "ln -sf {gunicorn_root} {link_gunicorn}".format(
|
|
||||||
gunicorn_root=build_path,
|
|
||||||
link_gunicorn=link_path)
|
|
||||||
|
|
||||||
if env.debug:
|
|
||||||
logging.debug("\n")
|
|
||||||
logging.debug("--- in gunicorn ---\n")
|
|
||||||
for key in context.keys():
|
|
||||||
logging.debug("%s\t: %s" % (key, context[key]))
|
|
||||||
|
|
||||||
logging.debug('build_path\t: %s' %
|
|
||||||
build_path)
|
|
||||||
|
|
||||||
logging.debug('files_path\t: %s' %
|
|
||||||
files_path)
|
|
||||||
|
|
||||||
logging.debug('\n%s' % print_run(msg_link_gunicorn))
|
|
||||||
|
|
||||||
else:
|
|
||||||
|
|
||||||
upload_template(
|
|
||||||
filename=configuration.templates.gunicorn.conf.src,
|
|
||||||
destination=build_path,
|
|
||||||
context=context,
|
|
||||||
use_jinja=True,
|
|
||||||
backup=True,
|
|
||||||
template_dir=files_path)
|
|
||||||
|
|
||||||
run(msg_link_gunicorn)
|
|
||||||
|
|
||||||
|
|
||||||
@task
|
@task
|
||||||
def test(param):
|
def test(param):
|
||||||
status()
|
status()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue