From c40f0903ae6957b4d778fdb9f9cfee22ed695a70 Mon Sep 17 00:00:00 2001
From: "Alexander A. Klimov" <alexander.klimov@icinga.com>
Date: Fri, 12 Mar 2021 13:39:58 +0100
Subject: [PATCH] Add Debian Bullseye

---
 .gitlab-ci.yml             |  3 +++
 Makefile                   |  2 +-
 bullseye/Makefile          |  1 +
 bullseye/x86/Dockerfile    | 28 ++++++++++++++++++++++++++++
 bullseye/x86/Makefile      |  1 +
 bullseye/x86_64/Dockerfile | 28 ++++++++++++++++++++++++++++
 bullseye/x86_64/Makefile   |  1 +
 7 files changed, 63 insertions(+), 1 deletion(-)
 create mode 100644 bullseye/Makefile
 create mode 100644 bullseye/x86/Dockerfile
 create mode 100644 bullseye/x86/Makefile
 create mode 100644 bullseye/x86_64/Dockerfile
 create mode 100644 bullseye/x86_64/Makefile

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ecc7cb6..dfefbf5 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -18,6 +18,9 @@ before_script:
     - make -C ${CI_JOB_NAME}
     - '[ "$CI_COMMIT_REF_NAME" != master ] || make -C ${CI_JOB_NAME} push'
 
+bullseye:
+  <<: *build_job
+
 buster:
   <<: *build_job
 
diff --git a/Makefile b/Makefile
index 6199bc2..95c016d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-TARGETS := buster stretch
+TARGETS := bullseye buster stretch
 TARGETS_PUSH := $(TARGETS:=-push)
 TARGETS_CLEAN := $(TARGETS:=-clean)
 
diff --git a/bullseye/Makefile b/bullseye/Makefile
new file mode 100644
index 0000000..5575b72
--- /dev/null
+++ b/bullseye/Makefile
@@ -0,0 +1 @@
+include ../dist.mk
diff --git a/bullseye/x86/Dockerfile b/bullseye/x86/Dockerfile
new file mode 100644
index 0000000..fdd2dd2
--- /dev/null
+++ b/bullseye/x86/Dockerfile
@@ -0,0 +1,28 @@
+FROM i386/debian:bullseye
+
+ENV DEBIAN_FRONTEND=noninteractive
+
+RUN apt-get update \
+ && apt-get upgrade -y
+
+RUN apt-get install -y \
+  sudo wget curl tar expect git \
+  devscripts build-essential lintian ccache pbuilder aptitude apt-utils
+
+RUN echo "deb http://deb.debian.org/debian bullseye-backports main" >/etc/apt/sources.list.d/backports.list
+
+RUN curl https://packages.icinga.com/icinga.key | apt-key add - \
+ && DIST=$(awk -F"[)(]+" '/VERSION=/ {print $2}' /etc/os-release) \
+ && DIST=bullseye \
+ && echo "deb http://packages.icinga.com/debian icinga-${DIST} main" > /etc/apt/sources.list.d/${DIST}-icinga.list
+
+RUN groupadd -g 1000 build \
+ && useradd -u 1000 -g 1000 -m build \
+ && echo 'Defaults:build !requiretty' | tee -a /etc/sudoers \
+ && echo 'build ALL=(ALL:ALL) NOPASSWD: ALL' | tee -a /etc/sudoers \
+ && chown build.build /usr/local/bin
+
+USER build
+RUN git clone https://git.icinga.com/build-docker/scripts.git /usr/local/bin
+ENTRYPOINT ["/usr/local/bin/icinga-build-entrypoint"]
+CMD ["icinga-build-package"]
diff --git a/bullseye/x86/Makefile b/bullseye/x86/Makefile
new file mode 100644
index 0000000..15497f2
--- /dev/null
+++ b/bullseye/x86/Makefile
@@ -0,0 +1 @@
+include ../../image.mk
diff --git a/bullseye/x86_64/Dockerfile b/bullseye/x86_64/Dockerfile
new file mode 100644
index 0000000..82bd868
--- /dev/null
+++ b/bullseye/x86_64/Dockerfile
@@ -0,0 +1,28 @@
+FROM debian:bullseye
+
+ENV DEBIAN_FRONTEND=noninteractive
+
+RUN apt-get update \
+ && apt-get upgrade -y
+
+RUN apt-get install -y \
+  sudo wget curl tar expect git \
+  devscripts build-essential lintian ccache pbuilder aptitude apt-utils
+
+RUN echo "deb http://deb.debian.org/debian bullseye-backports main" >/etc/apt/sources.list.d/backports.list
+
+RUN curl https://packages.icinga.com/icinga.key | apt-key add - \
+ && DIST=$(awk -F"[)(]+" '/VERSION=/ {print $2}' /etc/os-release) \
+ && DIST=bullseye \
+ && echo "deb http://packages.icinga.com/debian icinga-${DIST} main" > /etc/apt/sources.list.d/${DIST}-icinga.list
+
+RUN groupadd -g 1000 build \
+ && useradd -u 1000 -g 1000 -m build \
+ && echo 'Defaults:build !requiretty' | tee -a /etc/sudoers \
+ && echo 'build ALL=(ALL:ALL) NOPASSWD: ALL' | tee -a /etc/sudoers \
+ && chown build.build /usr/local/bin
+
+USER build
+RUN git clone https://git.icinga.com/build-docker/scripts.git /usr/local/bin
+ENTRYPOINT ["/usr/local/bin/icinga-build-entrypoint"]
+CMD ["icinga-build-package"]
diff --git a/bullseye/x86_64/Makefile b/bullseye/x86_64/Makefile
new file mode 100644
index 0000000..15497f2
--- /dev/null
+++ b/bullseye/x86_64/Makefile
@@ -0,0 +1 @@
+include ../../image.mk
-- 
GitLab