debian-koji-osbuild/run-builder.sh
Christian Kellner cb7e4d76c5 plugins/builder: change location of config file
Make the path reflect the name of the package / project.
2020-09-07 18:39:13 +02:00

28 lines
832 B
Bash
Executable file

#!/usr/bin/bash
SHARE_DIR=/tmp/osbuild-composer-koji-test
DATA_DIR=/var/tmp/osbuild-koji-data
# this script must be run as root
if [ $UID != 0 ]; then
echo This script must be run as root.
exit 1
fi
# decide whether podman or docker should be used
if which podman 2>/dev/null >&2; then
CONTAINER_RUNTIME=podman
elif which docker 2>/dev/null >&2; then
CONTAINER_RUNTIME=docker
else
echo No container runtime found, install podman or docker.
exit 2
fi
${CONTAINER_RUNTIME} run --rm -i -t --name org.osbuild.koji.builder --network org.osbuild.koji \
-v "${SHARE_DIR}:/share:z" \
-v "${DATA_DIR}:/mnt:z" \
-v "${PWD}/container/builder/osbuild-koji.conf:/etc/koji-osbuild/builder.conf:z" \
--hostname org.osbuild.koji.kojid \
--add-host=composer:$(ip route show dev cni-podman0 | cut -d\ -f7) \
koji.builder