Sometimes status messages have an extra level of wrapping for some reason.
This commit is contained in:
parent
9c8de90378
commit
9a733a7320
1 changed files with 6 additions and 5 deletions
|
@ -115,20 +115,21 @@ class DockerfileBuildContext(object):
|
|||
current_step = 0
|
||||
built_image = None
|
||||
for status in unwrap_stream(build_status):
|
||||
status_str = str(status.encode('utf-8'))
|
||||
fully_unwrapped = status['message'] if 'message' in status else status
|
||||
status_str = str(fully_unwrapped.encode('utf-8'))
|
||||
logger.debug('Status: %s', status_str)
|
||||
step_increment = re.search(r'Step ([0-9]+) :', status)
|
||||
step_increment = re.search(r'Step ([0-9]+) :', status_str)
|
||||
if step_increment:
|
||||
self._build_logger(status_str, build_logs.COMMAND)
|
||||
current_step = int(step_increment.group(1))
|
||||
logger.debug('Step now: %s/%s' % (current_step, self._num_steps))
|
||||
with self._status as status:
|
||||
status['current_command'] = current_step
|
||||
with self._status as status_update:
|
||||
status_update['current_command'] = current_step
|
||||
continue
|
||||
else:
|
||||
self._build_logger(status_str)
|
||||
|
||||
complete = re.match(r'Successfully built ([a-z0-9]+)$', status)
|
||||
complete = re.match(r'Successfully built ([a-z0-9]+)$', status_str)
|
||||
if complete:
|
||||
built_image = complete.group(1)
|
||||
logger.debug('Final image ID is: %s' % built_image)
|
||||
|
|
Reference in a new issue