Skip to content

Commit

Permalink
Make manifests more beautiful
Browse files Browse the repository at this point in the history
  • Loading branch information
mathbunnyru committed Nov 3, 2023
1 parent af37e9c commit 61e2710
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions tagging/manifests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
),
"```",
]
)
Expand Down Expand Up @@ -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}",
"```",
Expand All @@ -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"),
]
)
Expand All @@ -89,6 +96,8 @@ def markdown_piece(container: Container) -> str:
[
"## Apt Packages",
"",
"`apt list --installed`:",
"",
quoted_output(container, "apt list --installed"),
]
)
Expand Down

0 comments on commit 61e2710

Please sign in to comment.