1
This commit is contained in:
parent
55f9ca6a35
commit
875a903f0e
@ -48,14 +48,13 @@ class DeployGit:
|
|||||||
url = self.infos[0][4]
|
url = self.infos[0][4]
|
||||||
pre_script = self.infos[0][5]
|
pre_script = self.infos[0][5]
|
||||||
self.tag_name = "{name}{now}".format(name=self.name, now=self.now)
|
self.tag_name = "{name}{now}".format(name=self.name, now=self.now)
|
||||||
pdb.set_trace()
|
|
||||||
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} && cd .. && tar zcvf {tag_name}.tar.gz {name} ".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+'tag.gz'
|
self.tag_file = "/data/publish/git/"+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:
|
||||||
@ -65,6 +64,7 @@ class DeployGit:
|
|||||||
for line in self.infos:
|
for line in self.infos:
|
||||||
if line:
|
if line:
|
||||||
hosts, paths, user, _, _, start_script = line
|
hosts, paths, user, _, _, start_script = line
|
||||||
|
hosts = hosts.split(',')
|
||||||
hostfile = self.write_host(hosts)
|
hostfile = self.write_host(hosts)
|
||||||
an = AnsibleAPI(hostfile)
|
an = AnsibleAPI(hostfile)
|
||||||
data = {'paths': paths, 'desc_path': self.tag_name, 'user': user,
|
data = {'paths': paths, 'desc_path': self.tag_name, 'user': user,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user