@@ -375,7 +375,8 @@ def _endtest(self, container:Container, tag:str, build_info:dict[str,str], packa
375375 "test_results" : self .tag_report_tests [tag ]["test" ],
376376 "test_success" : test_success ,
377377 "runtime" : runtime ,
378- "build_url" : self .make_build_url (tag )
378+ "build_url" : self .get_build_url (tag ),
379+ "platform" : self .get_platform (tag ).upper ()
379380 }
380381 self .report_containers [tag ]["has_warnings" ] = any (warning [1 ] for warning in self .report_containers [tag ]["warnings" ].items ())
381382
@@ -511,6 +512,39 @@ def get_build_version(self,container:Container,tag:str) -> str:
511512 self .report_status = "FAIL"
512513 return build_version
513514
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+
514548 def get_build_info (self ,container :Container ,tag :str ) -> dict [str ,str ]:
515549 """Get the build information from the container object.
516550
@@ -527,7 +561,9 @@ def get_build_info(self,container:Container,tag:str) -> dict[str,str]:
527561 "created": "xxxx-xx-xx",
528562 "size": "100MB",
529563 "maintainer": "user"
530- "builder": "node"
564+ "builder": "node",
565+ "tag": "latest",
566+ "image": "linuxserver/xxx"
531567 }
532568 ```
533569 """
@@ -540,7 +576,9 @@ def get_build_info(self,container:Container,tag:str) -> dict[str,str]:
540576 "created" : container .attrs ["Config" ]["Labels" ]["org.opencontainers.image.created" ],
541577 "size" : "%.2f" % float (int (container .image .attrs ["Size" ])/ 1000000 ) + "MB" ,
542578 "maintainer" : container .attrs ["Config" ]["Labels" ]["maintainer" ],
543- "builder" : self .builder
579+ "builder" : self .builder ,
580+ "tag" : tag ,
581+ "image" : self .get_image_name ()
544582 }
545583 self ._add_test_result (tag , test , "PASS" , "-" , start_time )
546584 self .logger .success ("Get build info on tag '%s': PASS" , tag )
@@ -600,7 +638,7 @@ def report_render(self) -> None:
600638 report_containers = self .report_containers ,
601639 report_status = self .report_status ,
602640 meta_tag = self .meta_tag ,
603- image = self .image ,
641+ image = self .get_image_name () ,
604642 bucket = self .bucket ,
605643 region = self .region ,
606644 screenshot = self .screenshot ,
@@ -894,23 +932,6 @@ def create_docker_client(self) -> DockerClient|None:
894932 except Exception :
895933 self .logger .error ("Failed to create Docker client!" )
896934
897- def make_build_url (self , tag ) -> str :
898- """Create a build url for the image
899935
900- Args:
901- tag (str): The tag we are testing
902-
903- Returns:
904- str: Returns a build url
905- """
906- _ , container_name = self .image .split ("/" )
907- match self .image :
908- case _ if "lspipepr" in self .image :
909- return f"https://ghcr.io/linuxserver/lspipepr-{ container_name } :{ tag } "
910- case _ if "lsiodev" in self .image :
911- return f"https://ghcr.io/linuxserver/lsiodev-{ container_name } :{ tag } "
912- case _:
913- return f"https://ghcr.io/{ self .image } :{ tag } "
914-
915936class CIError (Exception ):
916937 pass
0 commit comments