From d643ab560b64629c4b76fe39dc0cb2a719a267a8 Mon Sep 17 00:00:00 2001 From: Jim Madge Date: Mon, 7 Aug 2023 13:25:38 +0100 Subject: [PATCH 1/5] Add --version flag --- nexus_allowlist/cli.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nexus_allowlist/cli.py b/nexus_allowlist/cli.py index cd42662..b5fd1db 100644 --- a/nexus_allowlist/cli.py +++ b/nexus_allowlist/cli.py @@ -7,6 +7,7 @@ from nexus_allowlist import actions from nexus_allowlist.exceptions import InitialPasswordError from nexus_allowlist.nexus import NexusAPI +from nexus_allowlist.__about__ import __version__ logging.basicConfig( format="{asctime} {levelname}:{message}", @@ -39,6 +40,12 @@ def main() -> None: default="80", help="Port of the Nexus server (default 80)", ) + parser.add_argument( + "--version", + action="version", + version=f"{parser.prog} {__version__}", + help="Print the version and exit" + ) # Group of arguments for packages packages_parser = argparse.ArgumentParser(add_help=False) From 9e562149f1e5292af9fbaab92794465eb6b951b8 Mon Sep 17 00:00:00 2001 From: Jim Madge Date: Mon, 7 Aug 2023 13:27:15 +0100 Subject: [PATCH 2/5] Log nexus-allowlist version in entrypoint --- entrypoint.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index da1ef52..5f75ee0 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -26,6 +26,9 @@ until curl -s "$NEXUS_HOST":"$NEXUS_PORT" > /dev/null; do done echo "$(timestamp) Nexus is running" +# Print version +nexus-allowlist --version + # Initial configuration if [ -f "$NEXUS_DATA_DIR/admin.password" ]; then echo "$(timestamp) Initial password file present, running initial configuration" From 7636578a06f3e8eb05abdc8b6b5bdfdb20503bdd Mon Sep 17 00:00:00 2001 From: Jim Madge Date: Mon, 7 Aug 2023 13:28:04 +0100 Subject: [PATCH 3/5] Bump version --- nexus_allowlist/__about__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nexus_allowlist/__about__.py b/nexus_allowlist/__about__.py index 458018d..9793744 100644 --- a/nexus_allowlist/__about__.py +++ b/nexus_allowlist/__about__.py @@ -1 +1 @@ -__version__ = "v0.6.0" +__version__ = "v0.7.0" From 532fcdb98d6fc5a3df1e7e811d898be3f27642ef Mon Sep 17 00:00:00 2001 From: Jim Madge Date: Mon, 7 Aug 2023 13:43:29 +0100 Subject: [PATCH 4/5] Add space in logger format --- nexus_allowlist/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nexus_allowlist/cli.py b/nexus_allowlist/cli.py index b5fd1db..b7223f1 100644 --- a/nexus_allowlist/cli.py +++ b/nexus_allowlist/cli.py @@ -10,7 +10,7 @@ from nexus_allowlist.__about__ import __version__ logging.basicConfig( - format="{asctime} {levelname}:{message}", + format="{asctime} {levelname}: {message}", style="{", datefmt="%Y-%m-%dT%H:%M:%S%z", level=logging.INFO, From 30f8d8b80ed95e7c38ca3b165d03f7bc7c45762f Mon Sep 17 00:00:00 2001 From: Jim Madge Date: Mon, 7 Aug 2023 13:52:36 +0100 Subject: [PATCH 5/5] Sort imports --- nexus_allowlist/cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nexus_allowlist/cli.py b/nexus_allowlist/cli.py index b7223f1..e2eca20 100644 --- a/nexus_allowlist/cli.py +++ b/nexus_allowlist/cli.py @@ -5,9 +5,9 @@ from pathlib import Path from nexus_allowlist import actions +from nexus_allowlist.__about__ import __version__ from nexus_allowlist.exceptions import InitialPasswordError from nexus_allowlist.nexus import NexusAPI -from nexus_allowlist.__about__ import __version__ logging.basicConfig( format="{asctime} {levelname}: {message}", @@ -44,7 +44,7 @@ def main() -> None: "--version", action="version", version=f"{parser.prog} {__version__}", - help="Print the version and exit" + help="Print the version and exit", ) # Group of arguments for packages