@@ -375,7 +375,8 @@ def _endtest(self, container:Container, tag:str, build_info:dict[str,str], packa
375
375
"test_results" : self .tag_report_tests [tag ]["test" ],
376
376
"test_success" : test_success ,
377
377
"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 ()
379
380
}
380
381
self .report_containers [tag ]["has_warnings" ] = any (warning [1 ] for warning in self .report_containers [tag ]["warnings" ].items ())
381
382
@@ -511,6 +512,39 @@ def get_build_version(self,container:Container,tag:str) -> str:
511
512
self .report_status = "FAIL"
512
513
return build_version
513
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
+
514
548
def get_build_info (self ,container :Container ,tag :str ) -> dict [str ,str ]:
515
549
"""Get the build information from the container object.
516
550
@@ -527,7 +561,9 @@ def get_build_info(self,container:Container,tag:str) -> dict[str,str]:
527
561
"created": "xxxx-xx-xx",
528
562
"size": "100MB",
529
563
"maintainer": "user"
530
- "builder": "node"
564
+ "builder": "node",
565
+ "tag": "latest",
566
+ "image": "linuxserver/xxx"
531
567
}
532
568
```
533
569
"""
@@ -540,7 +576,9 @@ def get_build_info(self,container:Container,tag:str) -> dict[str,str]:
540
576
"created" : container .attrs ["Config" ]["Labels" ]["org.opencontainers.image.created" ],
541
577
"size" : "%.2f" % float (int (container .image .attrs ["Size" ])/ 1000000 ) + "MB" ,
542
578
"maintainer" : container .attrs ["Config" ]["Labels" ]["maintainer" ],
543
- "builder" : self .builder
579
+ "builder" : self .builder ,
580
+ "tag" : tag ,
581
+ "image" : self .get_image_name ()
544
582
}
545
583
self ._add_test_result (tag , test , "PASS" , "-" , start_time )
546
584
self .logger .success ("Get build info on tag '%s': PASS" , tag )
@@ -600,7 +638,7 @@ def report_render(self) -> None:
600
638
report_containers = self .report_containers ,
601
639
report_status = self .report_status ,
602
640
meta_tag = self .meta_tag ,
603
- image = self .image ,
641
+ image = self .get_image_name () ,
604
642
bucket = self .bucket ,
605
643
region = self .region ,
606
644
screenshot = self .screenshot ,
@@ -894,23 +932,6 @@ def create_docker_client(self) -> DockerClient|None:
894
932
except Exception :
895
933
self .logger .error ("Failed to create Docker client!" )
896
934
897
- def make_build_url (self , tag ) -> str :
898
- """Create a build url for the image
899
935
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
-
915
936
class CIError (Exception ):
916
937
pass
0 commit comments