@@ -242,7 +242,7 @@ def run_build(build_dir=None,spec_file=None,repo_url=None,token=None,size=None,
242242 :param spec_file: the spec_file name to use, assumed to be in git repo
243243 :param repo_url: the url to download the repo from
244244 :param repo_id: the repo_id to uniquely identify the repo (in case name changes)
245- :param commit: the commit to checkout
245+ :param commit: the commit to checkout. If none provided, will use most recent.
246246 :param size: the size of the image to build. If none set, builds default 1024.
247247 :param credential: the credential to send the image to.
248248 :param verbose: print out extra details as we go (default True)
@@ -291,10 +291,10 @@ def run_build(build_dir=None,spec_file=None,repo_url=None,token=None,size=None,
291291 logging .info ('Checking out commit %s' ,params ['commit' ])
292292 os .system ('git checkout %s .' % (params ['commit' ]))
293293
294- # From here on out commit is used as a unique id, if we don't have one, randomly make one
294+ # From here on out commit is used as a unique id, if we don't have one, we use current
295295 else :
296- params ['commit' ] = uuid . uuid4 ().__str__ ()
297- logging .warning ("commit still not found in build , setting unique id to %s" ,params ['commit' ])
296+ params ['commit' ] = repo . commit ().__str__ ()
297+ logging .warning ("commit not specified , setting to current %s" , params ['commit' ])
298298
299299
300300 if os .path .exists (spec_file ):
0 commit comments