more changes to fab file
authorbobcall <bob@bobcall.me>
Mon, 1 Jul 2013 00:46:51 +0000 (20:46 -0400)
committerbobcall <bob@bobcall.me>
Mon, 1 Jul 2013 00:46:51 +0000 (20:46 -0400)
fabfile.py

index fa01b63fd0933194c6f521b3d185c21599fa30cb..7ae1f33aab4b616bbb83c8fd57f6200010e3e807 100644 (file)
@@ -41,6 +41,7 @@ def prod():
     env.confs = 'confs/beta/'
     env.branch = 'beta'
     env.run = virtenv_exec
+    env.gunicorn_addr = '127.0.0.1:8000'
 
 ######## Run Commands in Virutal Environment
 def virtenv_exec(command):
@@ -91,78 +92,16 @@ def make_virtualenv():
        run('virtualenv %s/%s' % (env.proj_dir, env.branch))
        env.run('pip install -r %s/reqs/dev.txt' % env.proj_dir )
 
-####### Supervisord
-@task
-def start_supervisord():
-       """
-       Starts Supervisord
-       """
-       config_file = '%s/confs/prod/supervisord.conf' % (env.proj_dir)
-       env.run('supervisord -c %s' % config_file)
-
-@task
-def stop_supervisord():
-       """
-       Stops supervisord
-       """
-       
-       config_file = '%s/confs/prod/supervisord.conf' % (env.proj_dir)
-       env.run('supervisorctl -c %s shutdown' % config_file)
-
-@task
-def restart_supervisord():
-       """
-       Restarts supervisord
-       """
-    
-       stop_supervisord()
-       start_supervisord()
-
-def supervisorctl(action, process):
-       """
-       Takes as arguments the name of the process as is
-       defined in supervisord.conf and the action that should
-       be performed on it: start|stop|restart.
-        """
-       config_file = '%s/confs/prod/supervisord.conf' % (env.proj_dir)
-       env.run('supervisorctl -c %s %s %s' % (config_file, action, process))
-
-@task
-def start_celeryd():
-    """
-    Starts the celeryd process
-    """
-    supervisorctl('start', 'celeryd')
-
-
-@task
-def stop_celeryd():
-    """
-    Stops the celeryd process
-    """
-    supervisorctl('stop', 'celeryd')
-
 @task
 def start_gunicorn():
     """
     Starts the gunicorn process
     """
-    supervisorctl('start', 'gunicorn')
-
-@task
-def stop_gunicorn():
-    """
-    Stops the gunicorn process
-    """
-    supervisorctl('stop', 'gunicorn')
-
+    env.run('%s/manage.py run_gunicorn -b %s -u %s -p var/run/gunicorn.pid' % (env.proj_root, env.gunicorn_addr, env.user)
 
 @task
-def restart_gunicorn():
-    """
-    Restarts the gunicorn process
-    """
-    supervisorctl('restart', 'gunicorn')
+def update_reqs():
+       env.run('pip install -r reqs/dev.txt')
 
 
 @task
@@ -177,7 +116,7 @@ def deploy():
     update_code()
     update_reqs()
     syncdb()
-    manage_static()
+    collect_static()
     restart_supervisord()