Fixes on deploy.sh
This commit is contained in:
parent
037146b8ff
commit
85be59976e
2
TODO.md
2
TODO.md
|
@ -380,3 +380,5 @@ try: import uwsgi to know its running uwsgi
|
|||
|
||||
|
||||
# LOCK beat lockfile
|
||||
|
||||
# Deprecate restart/start/stop services (do touch wsgi.py and fuck celery)
|
||||
|
|
|
@ -132,7 +132,6 @@ class Command(BaseCommand):
|
|||
self.stdout.write('writing new cert to \'%s\'' % cert_path)
|
||||
self.stdout.write('writing new cert key to \'%s\'' % key_path)
|
||||
run('openssl req -x509 -nodes -days 365 -newkey rsa:4096 -keyout %(key_path)s -out %(cert_path)s -subj "%(subject)s"' % context, display=True)
|
||||
|
||||
return cert_path, key_path
|
||||
|
||||
@check_root
|
||||
|
@ -204,7 +203,7 @@ class Command(BaseCommand):
|
|||
"""
|
||||
) % context
|
||||
|
||||
nginx_file = '/etc/nginx/conf.d/%(project_name)s.conf' % context
|
||||
nginx_file = '/etc/nginx/sites-available/%(project_name)s.conf' % context
|
||||
if server_name:
|
||||
context['server_name'] = server_name
|
||||
nginx_file = '/etc/nginx/sites-available/%(server_name)s.conf' % context
|
||||
|
@ -242,8 +241,14 @@ class Command(BaseCommand):
|
|||
"The old version has been placed at %(file)s.save\033[m" % context)
|
||||
|
||||
if server_name:
|
||||
run('ln -s /etc/nginx/sites-available/%(server_name)s.conf /etc/nginx/sites-enabled/' % context, error_codes=[0,1], display=True)
|
||||
run('ln -s /etc/uwsgi/apps-available/%(project_name)s.ini /etc/uwsgi/apps-enabled/' % context, error_codes=[0,1], display=True)
|
||||
run('ln -s /etc/nginx/sites-available/%(server_name)s.conf /etc/nginx/sites-enabled/' % context,
|
||||
error_codes=[0,1], display=True)
|
||||
else:
|
||||
run('rm /etc/nginx/sites-enabled/default')
|
||||
run('ln -s /etc/nginx/sites-available/%(project_name)s.conf /etc/nginx/sites-enabled/' % context,
|
||||
error_codes=[0,1], display=True)
|
||||
run('ln -s /etc/uwsgi/apps-available/%(project_name)s.ini /etc/uwsgi/apps-enabled/' % context,
|
||||
error_codes=[0,1], display=True)
|
||||
|
||||
rotate = textwrap.dedent("""\
|
||||
/var/log/nginx/*.log {
|
||||
|
|
|
@ -117,7 +117,7 @@ run "$PYTHON_BIN $MANAGE setupnginx --user $USER --noinput"
|
|||
run "service nginx start"
|
||||
|
||||
# Apply changes on related services
|
||||
run "$PYTHON_BIN $MANAGE restartservices"
|
||||
run "$PYTHON_BIN $MANAGE restartservices" || true
|
||||
|
||||
# Create orchestra superuser
|
||||
cat <<- EOF | $PYTHON_BIN $MANAGE shell
|
||||
|
|
Loading…
Reference in New Issue