mirror of
https://gitlab.kit.edu/kit/scc/sys/mail/exim-encrypt-dlfunc.git
synced 2025-12-06 07:33:55 +01:00
Lower Build-Depends on debhelper-compat to version 12 (which should have
This commit is contained in:
80
ci_container/build.sh
Executable file
80
ci_container/build.sh
Executable file
@ -0,0 +1,80 @@
|
||||
#!/bin/bash
|
||||
# shellcheck disable=SC1004
|
||||
|
||||
set -e
|
||||
|
||||
images=('debian:buster|buster' 'debian:bullseye|bullseye' 'ubuntu:focal|focal')
|
||||
|
||||
BASENAME='exim-encrypt-dlfunc-build'
|
||||
TAG='latest'
|
||||
REGISTRY='localhost:5000'
|
||||
USERNAME='nobody'
|
||||
PASSWORD='password'
|
||||
|
||||
while getopts "r:u:p:b:t:" OPTION; do
|
||||
case $OPTION in
|
||||
r)
|
||||
REGISTRY="${OPTARG}"
|
||||
;;
|
||||
u)
|
||||
USERNAME="${OPTARG}"
|
||||
;;
|
||||
p)
|
||||
PASSWORD="${OPTARG}"
|
||||
;;
|
||||
b)
|
||||
BASENAME="${OPTARG}"
|
||||
;;
|
||||
t)
|
||||
TAG="${OPTARG}"
|
||||
;;
|
||||
*)
|
||||
echo "Invalid argument"
|
||||
exit 127
|
||||
esac
|
||||
done
|
||||
|
||||
REGHOST="$(echo "${REGISTRY}" | cut -d/ -f1)"
|
||||
if [ "${REGISTRY}" != "none" ]; then
|
||||
echo "🔑 Logging into »${REGHOST}«"
|
||||
if ! buildah login --get-login "${REGHOST}" > /dev/null 2> /dev/null; then
|
||||
buildah login --password "${PASSWORD}" --username "${USERNAME}" "${REGHOST}"
|
||||
fi
|
||||
fi
|
||||
|
||||
for i in "${images[@]}"; do
|
||||
basectr=$(echo "${i}" | cut -d'|' -f1)
|
||||
name=$(echo "${i}" | cut -d'|' -f2)
|
||||
|
||||
ctr="$(buildah from "$basectr")"
|
||||
buildah run "$ctr" /bin/sh -c 'apt-get update; \
|
||||
DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical apt-get install -y \
|
||||
build-essential \
|
||||
git \
|
||||
exim4-dev \
|
||||
libsodium-dev \
|
||||
pkg-config \
|
||||
python3-pip \
|
||||
exim4-daemon-heavy \
|
||||
openssl \
|
||||
meson; \
|
||||
DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical apt-get install -y \
|
||||
debhelper \
|
||||
dh-make \
|
||||
devscripts \
|
||||
git-buildpackage \
|
||||
debsigs \
|
||||
gpgv1; \
|
||||
pip3 install meson ninja; \
|
||||
rm -rf /var/lib/apt/lists/*; \
|
||||
rm -rf ~/.cache/pip/*;'
|
||||
IMAGENAME="${BASENAME}-${name}"
|
||||
TARGET="${REGISTRY}/${BASENAME}-${name}:${TAG}"
|
||||
echo "⚙️ Assembling »${IMAGENAME}«"
|
||||
IMAGEID=$(buildah commit --format docker "$ctr" "${IMAGENAME}")
|
||||
if [ "${REGISTRY}" != "none" ]; then
|
||||
echo "🚀 Pushing »${TARGET}«"
|
||||
buildah push "${IMAGEID}" "${TARGET}"
|
||||
echo "💡 Finished »${BASENAME}«"
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user