Skip to content

Commit 91a7755

Browse files
Junkfiles deleted
1 parent 875b00e commit 91a7755

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed
Binary file not shown.

git_hooks/py_hooks/builder.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,14 @@ def __init__(self):
1010

1111

1212
def build_image(self,path=None,tag=''):
13-
image = self.client.images.build(path=path,tag=tag)
13+
try:
14+
image = self.client.images.build(path=path,tag=tag)
15+
return True
16+
17+
except:
18+
return False
19+
x = Builder()
20+
data = x.build_image(path='.',tag='hablela')
1421

1522

1623

git_hooks/py_hooks/builder_listener.py

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def docker_builder(ch, method, properties, body):
2020
git.Git().clone("git@{}:/home/git/version/{}".format(tmp["git_server"],tmp["repo_name"]),branch=tmp['branch_name'])
2121
img_status = image_builder.build_image(path='{}/'.format(tmp["repo_name"]),tag='{}'.format(tmp['repo_name']+tmp['branch_name']))
2222
if img_status:
23+
2324
os.system("docker tag {} {}/{}".format(tmp['repo_name']+tmp['branch_name'],registry_name,tmp['repo_name']+tmp['branch_name']))
2425
os.system("docker push {}/".format(registry_name,tmp['repo_name']+tmp['branch_name']))
2526
else:

0 commit comments

Comments
 (0)