From a6b8f050a0fa85daac2595f708643d53b2199b89 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 27 May 2022 13:14:31 +0200 Subject: [PATCH] contrib: add "journal" command to "nm-in-container.sh" for showing logs --- contrib/scripts/nm-in-container.sh | 40 ++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/contrib/scripts/nm-in-container.sh b/contrib/scripts/nm-in-container.sh index 6d21d5ce68..7907537fb6 100755 --- a/contrib/scripts/nm-in-container.sh +++ b/contrib/scripts/nm-in-container.sh @@ -9,14 +9,17 @@ set -e # - build: build a new image, named "$CONTAINER_NAME_REPOSITORY:$CONTAINER_NAME_TAG" ("nm:nm") # - run: start the container and tag it "$CONTAINER_NAME_NAME" ("nm") # - exec: run bash inside the container +# - journal|j: print the journal from inside the container # - stop: stop the container # - clean: delete the container and the image. # # Options: # --no-cleanup: don't delete the CONTAINERFILE and other artifacts # --stop: only has effect with "run". It will stop the container afterwards. -# -- [COMMAND]: with command "exec", provide a command to run in the container. -# Defaults to "bash". +# -- [EXTRA_ARGS]: +# - with command "exec", provide a command and arguments to run in the container. +# Defaults to "bash". +# - with command "journal", additional arguments that are passed to journalctl. # # It bind mounts the current working directory inside the container. # You can run `make install` and run tests. @@ -32,11 +35,13 @@ CONTAINER_NAME_REPOSITORY=${CONTAINER_NAME_REPOSITORY:-nm} CONTAINER_NAME_TAG=${CONTAINER_NAME_TAG:-nm} CONTAINER_NAME_NAME=${CONTAINER_NAME_NAME:-nm} +EXEC_ENV=() + ############################################################################### usage() { cat <