fabfile.py
branchdevel
changeset 280 c96d569a8ac8
parent 277 f65edc0382cc
child 294 0e75bd39767d
equal deleted inserted replaced
278:4d376a97e663 280:c96d569a8ac8
     1 from fabric.api import local, run, env 
     1 from fabric.api import local, run, env 
     2 from fabric.operations import put
     2 from fabric.operations import put
     3 
       
     4 
     3 
     5 from iro import __version__
     4 from iro import __version__
     6 import ngdatabase
     5 import ngdatabase
     7 
     6 
     8 ngmodules = {"directory": "/home/hefee/hg/ngmod/init",
     7 ngmodules = {"directory": "/home/hefee/hg/ngmod/init",
    17 
    16 
    18 def hal():
    17 def hal():
    19     env.hosts = ['sandy@hal.netzguerilla.net']
    18     env.hosts = ['sandy@hal.netzguerilla.net']
    20     env.directory = "iro"
    19     env.directory = "iro"
    21 
    20 
    22 
       
    23 def prepare_deploy():
    21 def prepare_deploy():
    24     local("python setup.py sdist")
    22     local("python setup.py sdist")
    25 
    23 
    26 def virtualenv(cmd):
    24 def virtualenv(cmd):
    27     run("%s && %s"  % (env.activate, cmd))
    25     run("%s && %s"  % (env.activate, cmd))
    31     put("dist/iro-%s.tar.gz"%__version__,"%s/dist/"%env.directory)
    29     put("dist/iro-%s.tar.gz"%__version__,"%s/dist/"%env.directory)
    32     put("%(directory)s/dist/ngmodules-%(version)s-py2.7.egg"%ngmodules,"%s/dist/"%env.directory)
    30     put("%(directory)s/dist/ngmodules-%(version)s-py2.7.egg"%ngmodules,"%s/dist/"%env.directory)
    33     virtualenv("easy_install %s/dist/ngmodules-%s-py2.7.egg"%(env.directory,ngmodules["version"]))
    31     virtualenv("easy_install %s/dist/ngmodules-%s-py2.7.egg"%(env.directory,ngmodules["version"]))
    34     virtualenv("pip uninstall -y iro")
    32     virtualenv("pip uninstall -y iro")
    35     virtualenv("pip install %s/dist/iro-%s.tar.gz"%(env.directory,__version__))
    33     virtualenv("pip install %s/dist/iro-%s.tar.gz"%(env.directory,__version__))
    36 
       
    37 
    34 
    38 def prepare_tests():
    35 def prepare_tests():
    39     put("tests/*","%s/tests/"%env.directory)
    36     put("tests/*","%s/tests/"%env.directory)
    40 
    37 
    41 def startserver():
    38 def startserver():
    66     run("tar -xzf /tmp/web.tar.gz")
    63     run("tar -xzf /tmp/web.tar.gz")
    67     run("rm -r iro/*")
    64     run("rm -r iro/*")
    68     run("mv web/* %s/"%env.directory)
    65     run("mv web/* %s/"%env.directory)
    69     run("rmdir web")
    66     run("rmdir web")
    70     run("rm /tmp/web.tar.gz")
    67     run("rm /tmp/web.tar.gz")
       
    68 
       
    69 def web():
       
    70     createweb()
       
    71     pushweb()