Commits

Mikhail Korobov  committed cc105a7

pip_setup_conf command. See #14. Thanks Vladimir Mihailenco for work on this.

  • Participants
  • Parent commits e099d9d

Comments (0)

Files changed (4)

File docs/CHANGES.rst

 CHANGES
 =======
 
+dev
+---
+
+- ``verify_exists`` argument of ``fab_deploy.utils.upload_config_template``
+  function was renamed to ``skip_unexistent``; it now also passes all extra
+  kwargs directly to fabric's ``upload_template``.
+- ``fab_deploy.virtualenv.pip_setup_conf`` command for uploading pip.conf.
+
 0.6 (2011-03-11)
 ----------------
 - custom project layouts support (thanks Vladimir Mihailenco):

File fab_deploy/deploy.py

     virtualenv.virtualenv_create()
     make_clone()
 
-#    virtualenv.pip_setup_conf()
     virtualenv.pip_install(env.conf.PIP_REQUIREMENTS, restart=False)
 
     setup_web_server()

File fab_deploy/utils.py

         return inner
     return decorator
 
-def upload_config_template(name, to=None, check_existence=False):
+def upload_config_template(name, to=None, skip_unexistent=False, **kwargs):
     if to is None:
         base_dir = env.conf['ENV_DIR'] + "/etc/"
         run('mkdir -p ' + base_dir)
         to = base_dir + name
     config_template = _config_template_path(name)
-    if check_existence and not os.path.exists(config_template):
+    if config_template is None and skip_unexistent:
         return
-    files.upload_template(config_template, to, env.conf, True)
+    files.upload_template(config_template, to, env.conf, use_jinja=True,
+                          **kwargs)
 
 def update_env():
     """

File fab_deploy/virtualenv.py

 from fab_deploy import utils
 
 
-__all__ = ['pip', 'pip_install', 'pip_update'] # , 'pip_setup_conf']
+__all__ = ['pip', 'pip_install', 'pip_update', 'pip_setup_conf']
 
 
 @utils.inside_src
     if restart:
         apache.touch()
 
-#def pip_setup_conf():
-#    """ Sets up pip.conf file """
-#    utils.upload_config_template('pip.conf',
-#        env.conf.HOME_DIR + '/.pip/pip.conf', check_existence=True)
+def pip_setup_conf():
+    """ Sets up pip.conf file """
+    utils.upload_config_template('pip.conf',
+        env.conf.HOME_DIR + '/.pip/pip.conf', skip_unexistent=True)
 
 def virtualenv_create():
     run('mkdir -p envs')