Fixes on deploy.sh

This commit is contained in:
Marc Aymerich 2015-05-05 20:55:54 +00:00
parent 037146b8ff
commit 85be59976e
3 changed files with 14 additions and 7 deletions

View File

@ -380,3 +380,5 @@ try: import uwsgi to know its running uwsgi
# LOCK beat lockfile # LOCK beat lockfile
# Deprecate restart/start/stop services (do touch wsgi.py and fuck celery)

View File

@ -132,7 +132,6 @@ class Command(BaseCommand):
self.stdout.write('writing new cert to \'%s\'' % cert_path) self.stdout.write('writing new cert to \'%s\'' % cert_path)
self.stdout.write('writing new cert key to \'%s\'' % key_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) 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 return cert_path, key_path
@check_root @check_root
@ -204,7 +203,7 @@ class Command(BaseCommand):
""" """
) % context ) % 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: if server_name:
context['server_name'] = server_name context['server_name'] = server_name
nginx_file = '/etc/nginx/sites-available/%(server_name)s.conf' % context 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) "The old version has been placed at %(file)s.save\033[m" % context)
if server_name: 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/nginx/sites-available/%(server_name)s.conf /etc/nginx/sites-enabled/' % context,
run('ln -s /etc/uwsgi/apps-available/%(project_name)s.ini /etc/uwsgi/apps-enabled/' % context, error_codes=[0,1], display=True) 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("""\ rotate = textwrap.dedent("""\
/var/log/nginx/*.log { /var/log/nginx/*.log {

View File

@ -117,7 +117,7 @@ run "$PYTHON_BIN $MANAGE setupnginx --user $USER --noinput"
run "service nginx start" run "service nginx start"
# Apply changes on related services # Apply changes on related services
run "$PYTHON_BIN $MANAGE restartservices" run "$PYTHON_BIN $MANAGE restartservices" || true
# Create orchestra superuser # Create orchestra superuser
cat <<- EOF | $PYTHON_BIN $MANAGE shell cat <<- EOF | $PYTHON_BIN $MANAGE shell