Permalink
Browse files

Update docs and fabfile for a single server.

  • Loading branch information...
1 parent dc2fa4b commit ef1e5b2e6bef9da82d512ee86a5b72d23203b2c0 @ericholscher ericholscher committed Apr 4, 2013
Showing with 30 additions and 8 deletions.
  1. +11 −0 deploy/fab/README.rst
  2. +19 −8 deploy/fab/fabfile.py
View
@@ -1,6 +1,17 @@
How to use
==========
+Single Server
+-------------
+
+Yes, this could be better, but it's workable for now.
+
+::
+
+fab -H root@166.78.178.218 all fix_perms:docs
+# As docs user
+fab -H 166.78.178.218 setup_db
+
Build
-----
View
@@ -7,23 +7,25 @@
all_users = ['docs', 'builder']
required_dirs = ['checkouts', 'etc', 'run', 'log']
-def build():
+def all():
install_packages('build')
+ install_packages('web')
+ install_packages('db')
users('docs')
checkout('docs')
setup_env('docs')
- """
- users('build')
- checkout('build')
- setup_env('build')
- """
+def build():
+ install_packages('build')
+ users('docs')
+ checkout('docs')
+ setup_env('docs')
def web():
install_packages('web')
users('docs')
checkout('docs')
- setup_env()
+ setup_env('docs')
def db():
@@ -104,10 +106,19 @@ def setup_env(user=None):
#put('files/%s_local_settings.py' % user, '%s/checkouts/readthedocs.org/readthedocs/settings/local_settings.py' % home)
run('%s/bin/pip install -U supervisor ipython gunicorn' % home)
+def fix_perms(user=None):
+ if user:
+ users = [user]
+ else:
+ users = all_users
+ for user in users:
+ env.user = user
+ home = '/home/%s' % user
+ sudo('chown -R %s:%s %s' % (user, user, home))
def setup_db():
env.user = "docs"
- home = '/home/%s' % user
+ home = '/home/%s' % env.user
with cd('%s/checkouts/readthedocs.org/readthedocs' % home):
run('./manage.py syncdb --noinput')
run('./manage.py migrate')

0 comments on commit ef1e5b2

Please sign in to comment.