@@ -374,7 +374,9 @@ def _endtest(self, container:Container, tag:str, build_info:dict[str,str], packa
374
374
"build_info" : build_info ,
375
375
"test_results" : self .tag_report_tests [tag ]["test" ],
376
376
"test_success" : test_success ,
377
- "runtime" : runtime
377
+ "runtime" : runtime ,
378
+ "build_url" : self .get_build_url (tag ),
379
+ "platform" : self .get_platform (tag ).upper ()
378
380
}
379
381
self .report_containers [tag ]["has_warnings" ] = any (warning [1 ] for warning in self .report_containers [tag ]["warnings" ].items ())
380
382
@@ -510,6 +512,39 @@ def get_build_version(self,container:Container,tag:str) -> str:
510
512
self .report_status = "FAIL"
511
513
return build_version
512
514
515
+ def get_image_name (self ) -> str :
516
+ """Get the image name from the IMAGE env.
517
+
518
+ Returns:
519
+ str: The container name
520
+ """
521
+ _ , container_name = self .image .split ("/" )
522
+ match self .image :
523
+ case _ if "lspipepr" in self .image :
524
+ return f"linuxserver/lspipepr-{ container_name } "
525
+ case _ if "lsiodev" in self .image :
526
+ return f"linuxserver/lsiodev-{ container_name } "
527
+ case _:
528
+ return self .image
529
+
530
+ def get_build_url (self , tag ) -> str :
531
+ """Get the build url from the IMAGE env.
532
+
533
+ Args:
534
+ tag (str): The tag we are testing
535
+
536
+ Returns:
537
+ dict: Returns a dictionary with the build url and container name
538
+ """
539
+ _ , container_name = self .image .split ("/" )
540
+ match self .image :
541
+ case _ if "lspipepr" in self .image :
542
+ return f"https://ghcr.io/linuxserver/lspipepr-{ container_name } :{ tag } "
543
+ case _ if "lsiodev" in self .image :
544
+ return f"https://ghcr.io/linuxserver/lsiodev-{ container_name } :{ tag } "
545
+ case _:
546
+ return f"https://ghcr.io/{ self .image } :{ tag } "
547
+
513
548
def get_build_info (self ,container :Container ,tag :str ) -> dict [str ,str ]:
514
549
"""Get the build information from the container object.
515
550
@@ -526,7 +561,9 @@ def get_build_info(self,container:Container,tag:str) -> dict[str,str]:
526
561
"created": "xxxx-xx-xx",
527
562
"size": "100MB",
528
563
"maintainer": "user"
529
- "builder": "node"
564
+ "builder": "node",
565
+ "tag": "latest",
566
+ "image": "linuxserver/xxx"
530
567
}
531
568
```
532
569
"""
@@ -539,7 +576,9 @@ def get_build_info(self,container:Container,tag:str) -> dict[str,str]:
539
576
"created" : container .attrs ["Config" ]["Labels" ]["org.opencontainers.image.created" ],
540
577
"size" : "%.2f" % float (int (container .image .attrs ["Size" ])/ 1000000 ) + "MB" ,
541
578
"maintainer" : container .attrs ["Config" ]["Labels" ]["maintainer" ],
542
- "builder" : self .builder
579
+ "builder" : self .builder ,
580
+ "tag" : tag ,
581
+ "image" : self .get_image_name ()
543
582
}
544
583
self ._add_test_result (tag , test , "PASS" , "-" , start_time )
545
584
self .logger .success ("Get build info on tag '%s': PASS" , tag )
@@ -599,7 +638,7 @@ def report_render(self) -> None:
599
638
report_containers = self .report_containers ,
600
639
report_status = self .report_status ,
601
640
meta_tag = self .meta_tag ,
602
- image = self .image ,
641
+ image = self .get_image_name () ,
603
642
bucket = self .bucket ,
604
643
region = self .region ,
605
644
screenshot = self .screenshot ,
@@ -892,6 +931,7 @@ def create_docker_client(self) -> DockerClient|None:
892
931
return docker .from_env ()
893
932
except Exception :
894
933
self .logger .error ("Failed to create Docker client!" )
934
+
895
935
896
936
class CIError (Exception ):
897
937
pass
0 commit comments