more minor changes to fabfile and changed location of beta configs from stag
authorbobcall <bob@bobcall.me>
Mon, 15 Jul 2013 18:33:50 +0000 (14:33 -0400)
committerbobcall <bob@bobcall.me>
Mon, 15 Jul 2013 18:33:50 +0000 (14:33 -0400)
confs/beta/gunicorn.conf [new file with mode: 0644]
confs/beta/supervisord.conf [new file with mode: 0644]
confs/stag/gunicorn.conf [deleted file]
confs/stag/supervisord.conf [deleted file]
fabfile.py

diff --git a/confs/beta/gunicorn.conf b/confs/beta/gunicorn.conf
new file mode 100644 (file)
index 0000000..e2e1a29
--- /dev/null
@@ -0,0 +1,7 @@
+import multiprocessing
+
+bind = '127.0.0.1:8000'
+workers = multiprocessing.cpu_count() * 2 + 1
+pid = 'var/run/gunicorn.pid'
+access_logfile = 'var/log/gunicorn/access.log'
+error_logfile = 'var/log/gunicorn/error.log'
diff --git a/confs/beta/supervisord.conf b/confs/beta/supervisord.conf
new file mode 100644 (file)
index 0000000..09ee3c0
--- /dev/null
@@ -0,0 +1,40 @@
+[supervisord]
+logfile = var/log/supervisord.log
+logfile_maxbytes = 10MB
+logfile_backups = 5
+loglevel = info
+pidfile = var/run/supervisord.pid
+
+[supervisorctl]
+serverurl = unix://var/run/supervisor.sock
+
+[unix_http_server]
+file = var/run/supervisor.sock
+chmod = 0777
+
+[rpcinterface:supervisor]
+supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
+
+[program:gunicorn]
+environment = DJANGO_SETTINGS_MODULE=karmaworld.settings.stag
+command = gunicorn -c confs/prod/gunicorn.conf karmaworld.wsgi:application
+autostart = true
+autorestart = true
+redirect_stderr = true
+stopsignal = QUIT
+
+[program:celeryd]
+environment = DJANGO_SETTINGS_MODULE=karmaworld.settings.stag
+command = python manage.py celery worker --app=karmaworld.celery.config -l info
+autorestart = true
+redirect_stderr = true
+stdout_logfile = var/log/celeryd.log
+priority = 2
+
+[program:celerybeat]
+environment = DJANGO_SETTINGS_MODULE=karmaworld.settings.stag
+command = python manage.py celery beat --app=karmaworld.celery.config --pidfile=var/run/celerybeat.pid -s var/run/celerybeat-schedule -l info
+autorestart = true
+redirect_stderr = true
+stdout_logfile = var/log/celerybeat.log
+priority = 3
diff --git a/confs/stag/gunicorn.conf b/confs/stag/gunicorn.conf
deleted file mode 100644 (file)
index e2e1a29..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-import multiprocessing
-
-bind = '127.0.0.1:8000'
-workers = multiprocessing.cpu_count() * 2 + 1
-pid = 'var/run/gunicorn.pid'
-access_logfile = 'var/log/gunicorn/access.log'
-error_logfile = 'var/log/gunicorn/error.log'
diff --git a/confs/stag/supervisord.conf b/confs/stag/supervisord.conf
deleted file mode 100644 (file)
index 09ee3c0..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-[supervisord]
-logfile = var/log/supervisord.log
-logfile_maxbytes = 10MB
-logfile_backups = 5
-loglevel = info
-pidfile = var/run/supervisord.pid
-
-[supervisorctl]
-serverurl = unix://var/run/supervisor.sock
-
-[unix_http_server]
-file = var/run/supervisor.sock
-chmod = 0777
-
-[rpcinterface:supervisor]
-supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
-
-[program:gunicorn]
-environment = DJANGO_SETTINGS_MODULE=karmaworld.settings.stag
-command = gunicorn -c confs/prod/gunicorn.conf karmaworld.wsgi:application
-autostart = true
-autorestart = true
-redirect_stderr = true
-stopsignal = QUIT
-
-[program:celeryd]
-environment = DJANGO_SETTINGS_MODULE=karmaworld.settings.stag
-command = python manage.py celery worker --app=karmaworld.celery.config -l info
-autorestart = true
-redirect_stderr = true
-stdout_logfile = var/log/celeryd.log
-priority = 2
-
-[program:celerybeat]
-environment = DJANGO_SETTINGS_MODULE=karmaworld.settings.stag
-command = python manage.py celery beat --app=karmaworld.celery.config --pidfile=var/run/celerybeat.pid -s var/run/celerybeat-schedule -l info
-autorestart = true
-redirect_stderr = true
-stdout_logfile = var/log/celerybeat.log
-priority = 3
index 84a2a853fe918cc93ef997495ae11e47974aae30..105e38d869dd8db05f85d086816cc71be2c0540d 100644 (file)
@@ -19,11 +19,10 @@ def here():
     """
 
     # This is required for the same reason as above
-    env.proj_dir = os.getcwd()
-    env.proj_root = os.path.dirname(env.proj_dir)
+    env.proj_root = '/var/www/karmaworld'
     env.cd = lcd
     env.reqs = 'reqs/dev.txt'
-    env.confs = 'confs/stag/'
+    env.confs = 'confs/%s' % env.branch
     env.branch = 'beta'
     env.run = virtenv_exec
 
@@ -39,7 +38,6 @@ def prod():
     env.user = 'djkarma'
     env.hosts = ['karmanotes.org']
     env.proj_root = '/var/www/karmaworld'
-    env.proj_dir = '/var/www/karmaworld'
     env.reqs = 'reqs/prod.txt'
     env.confs = 'confs/prod/'
     env.branch = 'beta'
@@ -56,12 +54,10 @@ def beta():
     env.user = 'djkarma'
     env.hosts = ['beta.karmanotes.org']
     env.proj_root = '/var/www/karmaworld'
-    env.proj_dir = '/var/www/karmaworld'
     env.reqs = 'reqs/prod.txt'
     env.confs = 'confs/prod/'
     env.branch = 'beta'
     env.run = virtenv_exec
-    env.gunicorn_addr = '127.0.0.1:8000'
 
 ######## Run Commands in Virutal Environment
 def virtenv_exec(command):
@@ -69,7 +65,7 @@ def virtenv_exec(command):
        Execute command in Virtualenv
        """
 
-        with virtualenv('%s/%s' % (env.proj_dir, env.branch)):
+        with virtualenv('%s/%s' % (env.proj_root, env.branch)):
                 run('%s' % (command))
 
 ######## Sync database
@@ -79,7 +75,7 @@ def syncdb():
        Sync Database
        """
 
-       env.run('%s/manage.py syncdb --noinput --migrate' % env.proj_dir )
+       env.run('%s/manage.py syncdb --migrate' % env.proj_dir )
 
 
 ####### Collect Static Files
@@ -234,4 +230,4 @@ def deploy():
     collect_static()
     restart_supervisord()
 ########## END COMMANDS
-
+ sethwoodworth started a discussion in the diff 6 days ago