mirror of
https://github.com/linuxserver/docker-ci.git
synced 2026-02-05 11:08:54 +08:00
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:
commit
55be4e87e8
5
ci/ci.py
5
ci/ci.py
@ -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")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user