-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Bookworm and ARM64, build all variants in script.
- Loading branch information
Showing
4 changed files
with
43 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
target/ | ||
Dockerfile | ||
build-deb-in-docker.sh | ||
*.deb | ||
DEB/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
FROM rust:1-bullseye | ||
|
||
RUN cargo install cargo-deb | ||
ARG DEBIAN_VER=bookworm | ||
FROM rust:1-${DEBIAN_VER} | ||
|
||
RUN apt-get -qy update | ||
RUN apt-get -qy install lsb-release | ||
RUN apt-get -qy install lsb-release libssl-dev | ||
RUN cargo install cargo-deb | ||
|
||
WORKDIR /root | ||
RUN mkdir /root/OUTPUT | ||
COPY . . | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,41 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
IMG="ldap_authz_proxy-deb:latest" | ||
is_arch_supported() { | ||
local arch=$1 | ||
local deb=$2 | ||
docker build --platform linux/$arch - <<EOF | ||
FROM rust:1-$deb | ||
RUN echo "Testing architecture $arch" | ||
EOF | ||
} | ||
|
||
for ARCH in amd64 arm64; do | ||
for DEBIAN_VER in bookworm bullseye; do | ||
if is_arch_supported $ARCH $DEBIAN_VER; then | ||
echo "=== Building for $DEBIAN_VER:$ARCH ===" | ||
IMG="ldap_authz_proxy-deb_${ARCH}:latest" | ||
docker build --platform linux/${ARCH} --build-arg DEBIAN_VER=${DEBIAN_VER} -t ${IMG} . | ||
docker run --platform linux/${ARCH} --rm -iv${PWD}:/root/OUTPUT ${IMG} bash -s << EOF | ||
cd /root | ||
cargo deb || exit 1 | ||
chown -v $(id -u):$(id -g) target/debian/*.deb | ||
docker build -t $IMG . | ||
docker run --rm -iv${PWD}:/root/OUTPUT $IMG sh -s << EOF | ||
cd /root | ||
cargo deb || exit 1 | ||
chown -v $(id -u):$(id -g) target/debian/*.deb | ||
cp -va target/debian/*.deb OUTPUT/ | ||
echo "============ Done. Built for: =============" | ||
lsb_release -a | ||
for x in target/debian/*.deb; do | ||
NEWFILE=\$(echo "\$x" | sed -E "s/(.*_)/\1${DEBIAN_VER}_/") | ||
mv "\$x" "\$NEWFILE" | ||
done | ||
cp -va target/debian/*.deb OUTPUT/ | ||
echo "============ Done. Built for: =============" | ||
lsb_release -a | ||
EOF | ||
else | ||
echo "=== Platform availability test (is_arch_supported) failed for $DEBIAN_VER:$ARCH. Skipping it..." | ||
fi | ||
done | ||
done | ||
|
||
echo "=============== $(pwd) ===============" | ||
ls -l *.deb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters