add a method to update ldt platform without release
authorymh <ymh.work@gmail.com>
Wed, 13 Jun 2012 16:36:52 +0200
changeset 79 4afe089760bc
parent 78 b244cd6dd537
child 81 b87b4aeed5d1
child 82 cb842369c5ca
add a method to update ldt platform without release
sbin/sync/fabfile.py
--- a/sbin/sync/fabfile.py	Wed Jun 13 15:10:35 2012 +0200
+++ b/sbin/sync/fabfile.py	Wed Jun 13 16:36:52 2012 +0200
@@ -165,6 +165,10 @@
     build_src(src_path)
     (_,version_str) = get_src_version(src_path)
     build_path = os.path.join(src_path,"dist","ldt-%s.tar.gz" % version_str)
+    sync_install_build(build_path)
+        
+
+def sync_install_build(build_path):
     res_trans = None
     try:
         res_trans = sync_build(build_path)
@@ -173,6 +177,7 @@
         if res_trans:
             remove_build(res_trans[0])
 
+
 def do_sync_web(version, export_path):
     print("do_sync_web with version %s and path %s" % (version,export_path))
     web_path = os.path.join(export_path,"web/") 
@@ -198,8 +203,25 @@
     export_path = export_version(version)
     do_sync_ldt(version, export_path)
     clean_export_folder(export_path)
-    relaunch_server()    
-
+    relaunch_server()
+    
+@task
+def update_ldt(version):
+    print(green("update ldt with version %s" % version))
+    export_path = export_version(version)
+    lib_path = os.path.join(export_path, "virtualenv", "res", "lib")
+    
+    f, pathname, description = imp.find_module("patch", [lib_path])
+    patch = imp.load_module("patch", f, pathname, description)
+    f, pathname, description = imp.find_module("lib_create_env", [lib_path])
+    lib_create_env = imp.load_module("lib_create_env", f, pathname, description)
+    
+    ldt_path = os.path.join(export_path, "virtualenv", "res", "src", lib_create_env.URLS['LDT']['local'])
+    
+    sync_install_build(ldt_path)
+    clean_export_folder(export_path)
+    relaunch_server()
+    
 @task
 def sync_platform(version):
     print(green("sync platform with version %s" % version))