Commits

Vladimir Mihailenco committed fd9638f

Update

Comments (0)

Files changed (2)

fab_deploy/deploy.py

 from fabric.contrib.console import confirm
 from fabric.contrib.files import upload_template
 
-from fab_deploy.utils import delete_pyc, run_as, detect_os
+from fab_deploy import utils
+from fab_deploy.utils import delete_pyc, run_as, detect_os, upload_config_template
 from fab_deploy.virtualenv import pip_install, pip_update
 from fab_deploy.django_commands import compress, migrate, syncdb, test
 from fab_deploy.system import prepare_server
     virtualenv_create()
     make_clone()
 
-    pip_install('all', restart=False)
+    upload_config_template('pip.conf', env.conf.HOME_DIR + '/.pip/pip.conf', check_existence=True)
+    pip_install(env.conf.PIP_REQUIREMENTS, restart=False)
 
     setup_web_server()
     update_django_config()
 
 def update_django_config(restart=True):
     """ Updates :file:`config.py` on server (using :file:`config.server.py`) """
-    upload_template('config.server.py', '%s/config.py' % env.conf['SRC_DIR'], env.conf, True)
+    upload_template(utils._project_path(env.conf.REMOTE_CONFIG_TEMPLATE),
+                    utils._remote_project_path(env.conf.LOCAL_CONFIG), env.conf, True)
     if restart:
         touch()
 
     """ Runs vcs ``up`` or ``checkout`` command on server and reloads
     mod_wsgi process. """
     delete_pyc()
-    with cd('src/'+ env.conf['INSTANCE_NAME']):
+    with cd('src/' + env.conf['INSTANCE_NAME']):
         vcs.up(branch)
     compress()
     touch()

fab_deploy/django_commands.py

     """ Runs migrate management command. Database backup is performed
     before migrations if ``do_backup=False`` is not passed. """
     if do_backup:
-        backup_dir = env.conf['ENV_DIR']+'/var/backups/before-migrate'
+        backup_dir = env.conf['ENV_DIR'] + '/var/backups/before-migrate'
         run('mkdir -p '+ backup_dir)
         mysqldump(backup_dir)
     manage('migrate --noinput %s' % params)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.