Skip to content

Commit

Permalink
build: add skipped tags to build summary
Browse files Browse the repository at this point in the history
  • Loading branch information
mkuf committed Mar 3, 2024
1 parent b82cc2e commit df3be95
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions scripts/build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@
"upstream": None,
"targets": [],
"versions": {},
"results": {
"summary": {
"success": [],
"failure": []
"failure": [],
"skipped": []
},
"labels": {
"org.prind.version": os.environ.get("GITHUB_SHA",(git.Repo(search_parent_directories=True)).head.object.hexsha),
Expand Down Expand Up @@ -132,6 +133,7 @@
# Check if the image already exists
docker.buildx.imagetools.inspect(tags[0])
logger.info("Image " + tags[0] + " exists, nothing to to.")
build["summary"]["skipped"].append(tags[0])
except:
if args.dry_run:
logger.debug("[dry-run] Would build " + tags[0])
Expand Down Expand Up @@ -160,11 +162,11 @@
logger.info("BUILD: " + line.strip())

logger.info("Successfully built " + tags[0])
build["results"]["success"].append(tags[0])
build["summary"]["success"].append(tags[0])
except:
logger.error("Failed to build " + tags[0])
build["results"]["failure"].append(tags[0])
logger.critical("Failed to build " + tags[0])
build["summary"]["failure"].append(tags[0])

logger.info("Build results: " + str(build["results"]))
if len(build["results"]["failure"]) > 0:
logger.info("Build Summary: " + str(build["summary"]))
if len(build["summary"]["failure"]) > 0:
sys.exit(1)

0 comments on commit df3be95

Please sign in to comment.