From 58567568afbcfca86c530ca975d7a115a198e667 Mon Sep 17 00:00:00 2001 From: ale <ale@incal.net> Date: Fri, 1 Mar 2019 10:03:00 +0000 Subject: [PATCH] Catch rebuild errors and continue --- gitlab_docker_autodep/deps.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/gitlab_docker_autodep/deps.py b/gitlab_docker_autodep/deps.py index 48775f7..72fea3f 100644 --- a/gitlab_docker_autodep/deps.py +++ b/gitlab_docker_autodep/deps.py @@ -102,11 +102,16 @@ def rebuild_deps(gitlab_url, registry_hostname, gitlab_token, logging.info('rebuilding %s', project.path_with_namespace) if not dry_run: - pipeline = rebuild(project, wait) - if pipeline.status not in ('success', 'pending'): - logging.error('ERROR: build failed for %s (%s)', - project.path_with_namespace, pipeline) - return + try: + pipeline = rebuild(project, wait) + if pipeline.status not in ('success', 'pending'): + logging.error('ERROR: build failed for %s (status: %s)', + project.path_with_namespace, pipeline.status) + continue + except gitlab.exceptions.GitlabError as e: + logging.error('ERROR: gitlab error: %s: %s', + project.path_with_namespace, str(e)) + continue if recurse: image_name = '%s/%s' % ( -- GitLab