Commit b491b7ff authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

Image.update’s pull option

parent e8920bae
...@@ -598,9 +598,11 @@ class Image(models.Model): ...@@ -598,9 +598,11 @@ class Image(models.Model):
def push(self): def push(self):
return ['docker', 'push', self.get_image_name()] return ['docker', 'push', self.get_image_name()]
def update(self): def update(self, pull=False):
image = check_output(['docker', 'images', '-q', self.get_image_name()]).decode().strip() image = check_output(['docker', 'images', '-q', self.get_image_name()]).decode().strip()
if not image: if not image:
if not pull:
return
try: try:
logger.info(f' pulling {self}') logger.info(f' pulling {self}')
check_output(self.pull()) check_output(self.pull())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment