mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[FIX] runbot: avoid trying to push unexisting image
When an image is build for the first time and the build fails, an ImageNotfound Exception is raised when trying to push the image. Whith this commit, a warning is emmited instead of crashing in such a case.
This commit is contained in:
parent
a8b3d6e205
commit
dda0170a89
@ -1,6 +1,7 @@
|
||||
import logging
|
||||
|
||||
from collections import defaultdict
|
||||
from docker.errors import ImageNotFound
|
||||
|
||||
from odoo import models, fields, api
|
||||
from odoo.tools import config, ormcache
|
||||
@ -145,7 +146,10 @@ class Host(models.Model):
|
||||
for dockerfile in self.env['runbot.dockerfile'].search([('to_build', '=', True)]):
|
||||
dockerfile._build(self)
|
||||
if is_registry:
|
||||
try:
|
||||
docker_push(dockerfile.image_tag)
|
||||
except ImageNotFound:
|
||||
_logger.warning("Image tag `%s` not found. Skipping push", dockerfile.image_tag)
|
||||
|
||||
_logger.info('Cleaning docker images...')
|
||||
for image in docker_images():
|
||||
|
Loading…
Reference in New Issue
Block a user