From 61e271032d2feeeaf05be2718fc743dd7eef0f07 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Fri, 3 Nov 2023 10:12:29 +0100 Subject: [PATCH] Make manifests more beautiful --- tagging/manifests.py | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/tagging/manifests.py b/tagging/manifests.py index 12e98020c3..7bd460fb44 100644 --- a/tagging/manifests.py +++ b/tagging/manifests.py @@ -13,7 +13,9 @@ def quoted_output(container: Container, cmd: str) -> str: return "\n".join( [ "```", - DockerRunner.run_simple_command(container, cmd, print_result=False), + DockerRunner.run_simple_command(container, cmd, print_result=False).strip( + "\n" + ), "```", ] ) @@ -46,11 +48,12 @@ def create_header( "", "## Build Info", "", - f"* Build datetime: {build_timestamp}", - f"* Docker image: `{registry}/{owner}/{short_image_name}:{commit_hash_tag}`", - f"* Docker image size: {image_size}", - f"* Git commit SHA: [{commit_hash}](https://github.com/jupyter/docker-stacks/commit/{commit_hash})", - "* Git commit message:", + f"- Build datetime: {build_timestamp}", + f"- Docker image: `{registry}/{owner}/{short_image_name}:{commit_hash_tag}`", + f"- Docker image size: {image_size}", + f"- Git commit SHA: [{commit_hash}](https://github.com/jupyter/docker-stacks/commit/{commit_hash})", + "- Git commit message:", + "", "```", f"{commit_message}", "```", @@ -73,10 +76,14 @@ def markdown_piece(container: Container) -> str: [ "## Python Packages", "", - quoted_output(container, "python --version"), + DockerRunner.run_simple_command(container, "python --version"), + "", + "`mamba info --quiet`:", "", quoted_output(container, "mamba info --quiet"), "", + "`mamba list`:", + "", quoted_output(container, "mamba list"), ] ) @@ -89,6 +96,8 @@ def markdown_piece(container: Container) -> str: [ "## Apt Packages", "", + "`apt list --installed`:", + "", quoted_output(container, "apt list --installed"), ] )