Merge pull request #44 from linuxserver/43-feat-run-docker-logs-with-t-switch

43 feat run docker logs with t switch
This commit is contained in:
Adam 2024-06-11 13:00:57 +01:00 committed by GitHub
commit 55be4e87e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -288,14 +288,13 @@ class CI(SetEnvs):
sbom: str = self.generate_sbom(tag)
logsfound: bool = self.watch_container_logs(container, tag) # Watch the logs for no more than 5 minutes
logsfound: bool = self.watch_container_logs(container, tag)
if not logsfound:
self.logger.error("Test of %s FAILED after %.2f seconds", tag, time.time() - start_time)
build_info = {"version": "-", "created": "-", "size": "-", "maintainer": "-"}
self._endtest(container, tag, build_info, sbom, False, start_time)
return
# build_version: str = self.get_build_version(container,tag) # Get the image build version
build_info: dict = self.get_build_info(container,tag) # Get the image build info
if build_info["version"] == "ERROR":
self.logger.error("Test of %s FAILED after %.2f seconds", tag, time.time() - start_time)
@ -329,7 +328,7 @@ class CI(SetEnvs):
runtime = "-"
if isinstance(start_time,(float, int)):
runtime = f"{time.time() - start_time:.2f}s"
logblob: Any = container.logs().decode("utf-8")
logblob: str = container.logs(timestamps=True).decode("utf-8")
self.create_html_ansi_file(logblob, tag, "log") # Generate an html container log file based on the latest logs
try:
container.remove(force="true")