1. Doug Latornell
  2. randopony-tetra

Commits

Doug Latornell  committed 6e25db2

Add init and install_app tasks to fabfile.

  • Participants
  • Parent commits c46b66b
  • Branches default

Comments (0)

Files changed (1)

File fabfile.py

View file
 """Fabric tasks for RandoPony-tetra web app.
 """
+import os
 from fabric.api import (
+    cd,
     env,
+    run,
     task,
     )
 from fabric.contrib.project import rsync_project
     """Deploy code to webfaction and restart app
     """
     rsync_code()
+    install_app()
     restart_app()
 
 
 @task
+def init():
+    """Prepare initial deployment to webfaction
+    """
+    rsync_code()
+    install_app()
+
+
+@task
 def rsync_code():
     """rsync project code to webfaction
     """
     exclusions = (
+        'build',
         'development.ini',
         'docs',
         'fabfile.py',
         'MANIFEST.in',
         'RandoPony.egg-info',
         'requirements',
+        'temp',
         '*.sublime-*',
         '.coveragerc',
         '*.db',
 
 
 @task
+def install_app():
+    """Install app on webfaction
+    """
+    code_dir = os.path.basename(os.getcwd())
+    with cd(app_dir):
+        run('bin/easy_install -U {}'.format(code_dir))
+
+
+@task
 def restart_app():
     """Restart app on webfaction
     """