From ce5e41f98076645809e33fb727bf8b97bd052e07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Budai?= Date: Thu, 8 Dec 2022 12:58:38 +0100 Subject: [PATCH] tools/run-koji-container: allow passing a custom certificate dir MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This helps with running the script locally. Signed-off-by: Ondřej Budai --- tools/run-koji-container.sh | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/tools/run-koji-container.sh b/tools/run-koji-container.sh index 0240119f3..227fe771d 100755 --- a/tools/run-koji-container.sh +++ b/tools/run-koji-container.sh @@ -42,14 +42,16 @@ kdc_exec() { } koji_start() { + local cert_dir + cert_dir="$1" trap koji_clean_up_bad_start EXIT # create a share directory which is used to share files between the host and containers mkdir "${SHARE_DIR}" - cp /etc/osbuild-composer/kojihub-key.pem "${SHARE_DIR}/key.pem" - cp /etc/osbuild-composer/kojihub-crt.pem "${SHARE_DIR}/crt.pem" - cp /etc/osbuild-composer/ca-crt.pem "${SHARE_DIR}/ca-crt.pem" + cp "${cert_dir}/kojihub-key.pem" "${SHARE_DIR}/key.pem" + cp "${cert_dir}/kojihub-crt.pem" "${SHARE_DIR}/crt.pem" + cp "${cert_dir}/ca-crt.pem" "${SHARE_DIR}/ca-crt.pem" ${CONTAINER_RUNTIME} network create org.osbuild.koji @@ -124,11 +126,13 @@ koji_start() { } # check arguments -if [[ $# -ne 1 || ( "$1" != "start" && "$1" != "stop" ) ]]; then +if [[ $# -lt 1 || ( "$1" != "start" && "$1" != "stop" ) ]]; then cat <