Merge "build: add timestamps to start/end of build"

This commit is contained in:
Zuul 2019-07-03 07:38:02 +00:00 committed by Gerrit Code Review
commit 7f47bf2d09

View File

@ -524,7 +524,8 @@ class BuildTask(DockerTask):
return return
image.status = STATUS_BUILDING image.status = STATUS_BUILDING
self.logger.info('Building') image.start = datetime.datetime.now()
self.logger.info('Building started at %s' % image.start)
if image.source and 'source' in image.source: if image.source and 'source' in image.source:
self.process_source(image, image.source) self.process_source(image, image.source)
@ -589,7 +590,9 @@ class BuildTask(DockerTask):
self.logger.exception('Unknown error when building') self.logger.exception('Unknown error when building')
else: else:
image.status = STATUS_BUILT image.status = STATUS_BUILT
self.logger.info('Built') now = datetime.datetime.now()
self.logger.info('Built at %s (took %s)' %
(now, now - image.start))
def squash(self): def squash(self):
image_tag = self.image.canonical_name image_tag = self.image.canonical_name