44
55from os import path
66from pathlib import Path
7+ from pybars import Compiler
78
9+ compiler = Compiler ()
810
911def processRelease (repo , payload ):
1012 base_path = Path (__file__ ).parent
@@ -27,13 +29,19 @@ def processRelease(repo, payload):
2729 commands .append ('nvm use ' + data ['node' ])
2830
2931 if 'build' in data ['release' ].keys ():
30- commands .append (data ['release' ]['build' ])
32+ source = data ['release' ]['build' ]
33+ template = compiler .compile (source )
34+ commands .append (template (payload ))
3135
3236 if 'deploy' in data ['release' ].keys ():
33- commands .append (data ['release' ]['deploy' ])
37+ source = data ['release' ]['deploy' ]
38+ template = compiler .compile (source )
39+ commands .append (template (payload ))
3440
3541 if 'cleanup' in data ['release' ].keys ():
36- commands .append (data ['release' ]['cleanup' ])
42+ source = data ['release' ]['cleanup' ]
43+ template = compiler .compile (source )
44+ commands .append (template (payload ))
3745
3846 subprocess .check_call (['git' , 'fetch' , '--all' , '--tags' ], cwd = data ['path' ])
3947 subprocess .check_call (['git' , 'checkout' , 'tags/' + payload ['release' ]['tag_name' ]], cwd = data ['path' ])
@@ -42,11 +50,12 @@ def processRelease(repo, payload):
4250 try :
4351 process .communicate (timeout = 300 )
4452 except subprocess .TimeoutExpired :
45- print ('Process was killed by timeout: 300 seconds. ' )
53+ print ('Process was killed by timeout: 300 seconds' )
4654 raise
4755 finally :
48- if process .poll () is None :
49- process .kill ()
50- process .communicate ()
56+ print ('Process complete' )
57+ process .kill ()
58+ process .communicate ()
59+ print ('Release complete!' )
5160
5261 return
0 commit comments