Skip to content

Commit

Permalink
Merge pull request #44 from linuxserver/43-feat-run-docker-logs-with-…
Browse files Browse the repository at this point in the history
…t-switch

43 feat run docker logs with t switch
  • Loading branch information
thespad authored Jun 11, 2024
2 parents b160501 + 4640609 commit 55be4e8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ci/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,14 +288,13 @@ def container_test(self, tag: str) -> None:


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)
Expand Down Expand Up @@ -329,7 +328,7 @@ def _endtest(self, container:Container, tag:str, build_info:dict[str,str], packa
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")
Expand Down

0 comments on commit 55be4e8

Please sign in to comment.