添加keys 发布接口
This commit is contained in:
parent
b33374dc26
commit
9e99ede961
@ -85,24 +85,24 @@ class DeployKeys:
|
|||||||
except Exception:
|
except Exception:
|
||||||
log.error(f"get remote {self.project} svn failed", exc_info=True)
|
log.error(f"get remote {self.project} svn failed", exc_info=True)
|
||||||
|
|
||||||
project_paths = os.path.join(self.svn_paths, self.project)
|
project_paths = os.path.join(self.svn_paths, self.project)
|
||||||
tar = tarfile.open(project_paths + '.tar.gz', 'w:gz')
|
tar = tarfile.open(project_paths + '.tar.gz', 'w:gz')
|
||||||
os.chdir(self.project_paths)
|
os.chdir(self.project_paths)
|
||||||
for f in os.listdir(self.svn_paths):
|
for f in os.listdir(self.svn_paths):
|
||||||
tar.add(f)
|
tar.add(f)
|
||||||
tar.close()
|
tar.close()
|
||||||
|
|
||||||
# 判断是否有生成tar包
|
# 判断是否有生成tar包
|
||||||
list_dir = os.listdir(project_paths)
|
list_dir = os.listdir(project_paths)
|
||||||
tar_files = list()
|
tar_files = list()
|
||||||
for i in list_dir:
|
for i in list_dir:
|
||||||
if i == "{0}.tar.gz".format(self.project) and os.path.isfile(os.path.join(project_paths, i)):
|
if i == "{0}.tar.gz".format(self.project) and os.path.isfile(os.path.join(project_paths, i)):
|
||||||
tar_files.append(os.path.join(project_paths, i))
|
tar_files.append(os.path.join(project_paths, i))
|
||||||
if len(tar_files) == 1:
|
if len(tar_files) == 1:
|
||||||
log.info("tarfile {0} config to tar.gz success".format(self.project))
|
log.info("tarfile {0} config to tar.gz success".format(self.project))
|
||||||
return tar_files
|
return tar_files
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
def build_hostfile(self, ip_addr):
|
def build_hostfile(self, ip_addr):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user