def svn_update_log(user, password, path, limit, logfile, *args): current_task.update_state(state="PROGRESS") repo = Svnrepo(path, user, password) repo.svn_update("all", *args) res = repo.svn_get_reversion(logfile, limit) return res
def web_export(self, reversion=None): svnurl = "svn://47.91.176.204/" + self.siteid svn_user = "******" svn_pass = "******" repo = Svnrepo(self.web_export_dir, svn_user, svn_pass) if reversion: res = repo.svn_update(reversion) else: genxin_code_dir(self.web_export_dir) res = repo.svn_checkout(svnurl, ccdir=self.web_export_dir)
def conf_export(self, reversion=None): if self.env == "huidu": svnurl = "svn://119.9.91.21/huidu_config/" + self.siteid + "_config" else: svnurl = "svn://119.9.91.21/1000_config/" + self.siteid + "_config" svn_user = "******" svn_pass = "******" repo = Svnrepo(self.conf_export_dir, svn_user, svn_pass) if reversion: res = repo.svn_update(reversion) else: genxin_code_dir(self.conf_export_dir) res = repo.svn_checkout(svnurl, ccdir=self.conf_export_dir)
def pub_export(self, reversion=None): if "m" in self.siteid: svnurl = "svn://119.9.91.21/1000m_public" else: svnurl = "svn://119.9.91.21/1000_public" svn_user = "******" svn_pass = "******" print "svn检出目录:%s" % self.pub_export_dir repo = Svnrepo(self.pub_export_dir, svn_user, svn_pass) if reversion: res = repo.svn_update(reversion) else: genxin_code_dir(self.pub_export_dir) res = repo.svn_checkout(svnurl, ccdir=self.pub_export_dir)
def svn_update_task(user, password, path, reversion, *args): current_task.update_state(state="PROGRESS") repo = Svnrepo(path, user, password) res = repo.svn_update(reversion, *args) return res
def svn_checkout_task(user, password, url, path, *args): current_task.update_state(state="PROGRESS") repo = Svnrepo(path, user, password) repo.svn_checkout(url, path, *args) return "svn_add_conf_200"
def last_release(self, classify, isphone=None): web_url = "svn://47.91.176.204/" + self.siteid if "f" in self.siteid: web_phone_url = "svn://47.91.176.204/" + self.siteid.replace( 'f', 'mf') else: web_phone_url = "svn://47.91.176.204/" + self.siteid + "m" pub_pc_url = "svn://119.9.91.21/1000_public" pub_phone_url = "svn://119.9.91.21/1000m_public" if classify == "web": print "web_start" repo = Svnrepo(self.web_export_dir, "yunwei", "4OTk2ZmI5M") pubrepo = Svnrepo(self.pub_export_dir, "yunwei", "tYbmhKpcv2") web_reversion = repo.svn_last_reversion(web_url) pub_pc_reversion = pubrepo.svn_last_reversion(pub_pc_url) if isphone: web_phone_reversion = repo.svn_last_reversion(web_phone_url) pub_phone_reversion = pubrepo.svn_last_reversion(pub_phone_url) return "web最新版本:" + web_reversion + " public最新版本:" + pub_pc_reversion + " 手机web最新版本:" + web_phone_reversion + " 手机public最新版本:" + pub_phone_reversion return "web最新版本:" + web_reversion + " public最新版本:" + pub_pc_reversion elif classify == "pa": print "pa_start" pubrepo = Svnrepo("/data", "yunwei", "tYbmhKpcv2") pub_pc_reversion = pubrepo.svn_last_reversion(pub_pc_url) return "public最新版本:" + pub_pc_reversion else: print "pam_statr" pubrepo = Svnrepo("/data", "yunwei", "tYbmhKpcv2") pub_phone_reversion = pubrepo.svn_last_reversion(pub_phone_url) return "手机public最新版本:" + pub_phone_reversion