Commits

Vladimir Mihailenco committed ca7580f

Add redis installation

  • Participants
  • Parent commits c1ff216

Comments (0)

Files changed (2)

File fabdeploy/api.py

 from . import fabd, system, git, version, virtualenv, nginx, django, pip, \
     postgres, mysql, supervisor, users, ssh, tar, gunicorn, uwsgi, rabbitmq, \
-    apache
+    apache, redis
 from .base import setup_fabdeploy
 from .containers import conf, DefaultConf
 from .task import Task

File fabdeploy/redis.py

+from fabric.api import sudo, abort
+
+from . import system
+from .task import Task
+
+
+__all__ = ['install']
+
+
+class Install(Task):
+    def do(self):
+        if self.conf.os in ['lucid', 'maverick', 'natty']:
+            sudo('add-apt-repository ppa:rwky/redis')
+            system.aptitude_update.run(force=True)
+            system.aptitude_install.run(packages='redis-server')
+        else:
+            abort('Fabdeploy can not install on %(os)s yet...')
+        sudo('rm --force /etc/nginx/sites-enabled/default')
+
+install = Install()