createrepo-docker/createrepo.sh
Markus Pesch c27600404c
All checks were successful
continuous-integration/drone/push Build is passing
chore(renovate): use configuration preset
2025-03-30 20:46:50 +02:00

21 lines
633 B
Bash
Executable File

#!/bin/bash
set -e
CONTAINER_RUNTIME=$(which docker)
CREATEREPO_IMAGE_FULLY_QUALIFIED="docker.io/volkerraschek/createrepo:0.17.2" # renovate: datasource=docker registryUrl=https://docker.io depName=volkerraschek/createrepo
CUSTOM_UID="${CUSTOM_UID:-"$(getent passwd "${USER}" | cut -d ':' -f 3)"}"
CUSTOM_GID="${CUSTOM_GID:-"$(getent passwd "${USER}" | cut -d ':' -f 4)"}"
# Extract last element of passed arguments
REPO_DIR="${*: -1}"
${CONTAINER_RUNTIME} run \
--rm \
--volume "${REPO_DIR}:${REPO_DIR}" \
--workdir "${REPO_DIR}" \
--user "${CUSTOM_UID}:${CUSTOM_GID}" \
"${CREATEREPO_IMAGE_FULLY_QUALIFIED}" "${@}"