예제 #1
0
 def UpdateServerInfo(self, si):
     return self.sendAndWaitRsp({
         "update_server": {
             "cookie": DataModel.Instance().GetCookie(),
             "si": si
         }
     })
예제 #2
0
 def DeleteServers(self, rids):
     return self.sendAndWaitRsp({
         "delete_servers": {
             "cookie": DataModel.Instance().GetCookie(),
             "rids": rids
         }
     })
예제 #3
0
 def QueryPms(self):
     try:
         return self.sendAndWaitRsp(
             {"query_pms": {
                 "cookie": DataModel.Instance().GetCookie()
             }})
     except Exception as e:
         print(e)
         return None
예제 #4
0
 def QueryServerInfo(self, rids):
     try:
         return self.sendAndWaitRsp({
             "query_server": {
                 "cookie": DataModel.Instance().GetCookie(),
                 "rids": rids
             }
         })
     except Exception as e:
         traceback.print_exc()
예제 #5
0
 def QueryUpdateDetail(self, prj, module, ver):
     try:
         return self.sendAndWaitRsp({
             "query_update_detail": {
                 "cookie": DataModel.Instance().GetCookie(),
                 "project": prj,
                 "module": module,
                 "version": ver
             }
         })
     except Exception as e:
         traceback.print_exc()
예제 #6
0
 def QueryMi(self, prj, module):
     try:
         return self.sendAndWaitRsp({
             "query_mi": {
                 "cookie": DataModel.Instance().GetCookie(),
                 "project": prj,
                 "module": module
             }
         })
     except Exception as e:
         traceback.print_exc()
         return None
예제 #7
0
 def onClieckLogin(self):
     rlt = RestfulApiClient().Login(self.editUsr.text(),self.editPassword.text())
     if not rlt or rlt["login_result"]["result"] != "success":
         self.failedTimes += 1
         self.labelToolTip.show()
         self.labelToolTip.setStyleSheet("color:red;font-size:18px")
         self.labelToolTip.setText("login failed, please input again")
         self.adjustSize()
         if self.failedTimes > 3: return self.reject()
     else:
         DataModel.Instance().UpdateUser(rlt["login_result"])
         return self.accept()
예제 #8
0
 def Publish(self, prj, module, ver, gids, detail, code, hash, url):
     return self.sendAndWaitRsp({
         "publish": {
             "cookie": DataModel.Instance().GetCookie(),
             "project": prj,
             "module": module,
             "version": ver,
             "gids": gids,
             "detail": detail,
             "code": code,
             "hash": hash,
             "url": url
         }
     })
예제 #9
0
파일: Publish.py 프로젝트: PrQiang/aods
 cfg = {
     "usr":
     "******",  # 登录UI用账号
     "password":
     "******",  # 登录UI用密码
     "pubUrl":
     "http://192.168.221.134:8210/",  # 发布后下载url路径
     "pubTopic":
     "publish",  # 
     "sftpAddr":
     [("192.168.221.134", 22, 'root', 'Baidu.com22')],  # sftp上传ip、端口、账号、密码
     "prjs": [
         # 项目名,模块名,发布版本号,待发布文件目录,待发布文件名称前缀,发布描述
         ("aods", "aods-x64-win", "0.0.0.0001", ".\\aods-x64-win\\",
          "aods-x64-win", "fix the bug .1.023,1"),
         ("aods", "aodc-x64-win", "0.0.0.0001", ".\\aodc-x64-win\\",
          "aodc-x64-win", "fix the bug .1.023,1")
     ]
 }
 rlt = RestfulApiClient().Login(cfg['usr'], cfg['password'])  # 修改为api发布消息
 if not rlt or rlt["login_result"]["result"] != "success":
     Log(LOG_ERROR, "Publish", "Failed to login")
     sys.exit(1)
 DataModel.Instance().UpdateUser(rlt["login_result"])
 p = Publish(cfg["sftpAddr"], cfg["pubUrl"])
 for (prj, mn, ver, folder, pubFileName, detail) in cfg["prjs"]:
     if not p.Publish(prj, mn, ver, folder, pubFileName, detail):
         os.system("pause")
         sys.exit(1)
 print("执行结束......")
 time.sleep(20.0)