This commit is contained in:
pengtao 2021-06-15 18:09:38 +08:00
parent 73ade474b2
commit c30322b5d8

View File

@ -51,10 +51,10 @@ class DeployGit:
if os.path.isdir('/data/publish/git/'+self.name): if os.path.isdir('/data/publish/git/'+self.name):
shutil.rmtree('/data/publish/git/'+self.name) shutil.rmtree('/data/publish/git/'+self.name)
build_cmd = "cd /data/publish/git && git clone {url} && cd {name} && sh {pre_script} && cd .. && tar zcvf {tag_name}.tar.gz {name} ".format( build_cmd = "cd /data/publish/git && git clone {url} && cd {name} && sh {pre_script} && tar zcvf {tag_name}.tar.gz * ".format(
name=self.name, url=url, tag_name=self.tag_name, pre_script=pre_script) name=self.name, url=url, tag_name=self.tag_name, pre_script=pre_script)
os.system(build_cmd) os.system(build_cmd)
self.tag_file = "/data/publish/git/"+self.tag_name+'.tar.gz' self.tag_file = "/data/publish/git/"+self.name+'/'+self.tag_name+'.tar.gz'
if os.path.isfile(self.tag_file): if os.path.isfile(self.tag_file):
return True return True
else: else:
@ -63,8 +63,7 @@ class DeployGit:
def _deploy_remote(self): def _deploy_remote(self):
for line in self.infos: for line in self.infos:
if line: if line:
pdb.set_trace() _, hosts, paths, user, _, _, start_script = line
_,hosts, paths, user, _, _, start_script = line
hosts = hosts.split(',') hosts = hosts.split(',')
hostfile = self.write_host(hosts) hostfile = self.write_host(hosts)
an = AnsibleAPI(hostfile) an = AnsibleAPI(hostfile)