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

allow_failure when no image has been succesffully built in a week

parent b0d509d3
Pipeline #2761 passed with stages
in 1 minute and 18 seconds
......@@ -9,6 +9,7 @@ from django.db.models import Q
from django.db.models.functions import Length
from django.db.utils import DataError
from django.template.loader import get_template
from django.utils import timezone
from django.utils.dateparse import parse_datetime
from django.utils.safestring import mark_safe
......@@ -819,6 +820,9 @@ class Image(models.Model):
self.image = r.json()['fsLayers'][0]['blobSum'].split(':')[1][:12]
self.created = parse_datetime(json.loads(r.json()['history'][0]['v1Compatibility'])['created'])
self.save()
if not self.allow_failure and (timezone.now() - self.created).days > 7:
self.allow_failure = True
self.save()
class CIBuild(models.Model):
......
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