From d0216a7ef0b400d4ae8d4d30146629a739258da2 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Thu, 19 Nov 2020 11:02:52 +0100 Subject: [PATCH] test: copy the plugin in the run scripts If called from within the source directory, i.e. the local plugin exists, copy those to the share directory so they can be picked up by the entry point scripts, in case the rpms are not found. --- test/run-builder.sh | 11 +++++++++++ test/run-koji-container.sh | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/test/run-builder.sh b/test/run-builder.sh index b58587d..86d47a8 100755 --- a/test/run-builder.sh +++ b/test/run-builder.sh @@ -25,6 +25,17 @@ builder_start() { GATEWAY_IP=$(${CONTAINER_RUNTIME} network inspect org.osbuild.koji | jq -r ".[0].plugins[0].ipam.ranges[0][0].gateway") echo "Gateway IP is $GATEWAY_IP" + # maybe copy the 'builder' plugin to the share dir + PLUGIN_NAME="builder" + PLUGIN_PATH="plugins/${PLUGIN_NAME}" + if [[ -f "${PLUGIN_PATH}/osbuild.py" ]]; then + PLUGIN_DEST="${SHARE_DIR}/${PLUGIN_PATH}" + + echo "[COPY] '${PLUGIN_NAME}' plugin to ${PLUGIN_DEST}" + mkdir -p "${PLUGIN_DEST}" + cp "${PLUGIN_PATH}/osbuild.py" "${PLUGIN_DEST}" + fi + ${CONTAINER_RUNTIME} run ${CONTAINER_FLAGS} \ --name org.osbuild.koji.builder --network org.osbuild.koji \ -v "${SHARE_DIR}:/share:z" \ diff --git a/test/run-koji-container.sh b/test/run-koji-container.sh index b5c7f1e..1420e7e 100755 --- a/test/run-koji-container.sh +++ b/test/run-koji-container.sh @@ -108,6 +108,17 @@ koji_start() { # koji data mkdir -p ${DATA_DIR}/koji/{packages,repos,work,scratch,repos-dist} + # maybe copy the 'hub' plugin to the share dir + PLUGIN_NAME="hub" + PLUGIN_PATH="plugins/${PLUGIN_NAME}" + if [[ -f "${PLUGIN_PATH}/osbuild.py" ]]; then + PLUGIN_DEST="${SHARE_DIR}/${PLUGIN_PATH}" + + echo "[COPY] '${PLUGIN_NAME}' plugin to ${PLUGIN_DEST}" + mkdir -p "${PLUGIN_DEST}" + cp "${PLUGIN_PATH}/osbuild.py" "${PLUGIN_DEST}" + fi + ${CONTAINER_RUNTIME} run -d --name org.osbuild.koji.koji --network org.osbuild.koji \ -v "${SHARE_DIR}:/share:z" \ -v "${DATA_DIR}:/mnt:z" \