From e83c42a23c21619c622ea1490f8df30acee7148c Mon Sep 17 00:00:00 2001 From: Erik Winkels Date: Fri, 31 Jan 2020 11:25:24 +0100 Subject: [PATCH] Add support for rec-43. --- build-scripts/docker/generate-repo-files.sh | 51 +++++++++++++-------- 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/build-scripts/docker/generate-repo-files.sh b/build-scripts/docker/generate-repo-files.sh index 6397ce1035..9026e32755 100755 --- a/build-scripts/docker/generate-repo-files.sh +++ b/build-scripts/docker/generate-repo-files.sh @@ -13,45 +13,63 @@ if [ "$1" = "" -o "$1" = "-?" -o "$1" = "-h" -o "$1" = "--help" ]; then exit 1 fi + write_centos() { OS=centos VERSION=$1 PKG=$2 CMD=$3 + cat < Dockerfile.$RELEASE.$OS-$VERSION FROM $OS:$VERSION RUN yum install -y epel-release bind-utils EOF + if [ "$VERSION" = "6" -o "$VERSION" = "7" ]; then cat <> Dockerfile.$RELEASE.$OS-$VERSION RUN yum install -y yum-plugin-priorities EOF fi + cat <> Dockerfile.$RELEASE.$OS-$VERSION RUN curl -o /etc/yum.repos.d/powerdns-$RELEASE.repo https://repo.powerdns.com/repo-files/$OS-$RELEASE.repo RUN yum install -y $PKG +EOF + + if [ "$RELEASE" = "rec-43" ]; then + cat <> Dockerfile.$RELEASE.$OS-$VERSION + +RUN mkdir /var/run/pdns-recursor +EOF + fi + + cat <> Dockerfile.$RELEASE.$OS-$VERSION CMD $CMD --version EOF } + write_debian_or_ubuntu() { OS=$1 VERSION=$2 PKG=$3 CMD=$4 + cat < pdns.list.$RELEASE.$OS-$VERSION deb [arch=amd64] http://repo.powerdns.com/$OS $VERSION-$RELEASE main EOF + # if not exists cat < pdns.debian-and-ubuntu Package: pdns-* Pin: origin repo.powerdns.com Pin-Priority: 600 EOF + cat < Dockerfile.$RELEASE.$OS-$VERSION FROM $OS:$VERSION @@ -64,21 +82,34 @@ COPY pdns.list.$RELEASE.$OS-$VERSION /etc/apt/sources.list.d/pdns.list RUN curl https://repo.powerdns.com/FD380FBB-pub.asc | apt-key add - RUN apt-get update RUN apt-get install -y $PKG +EOF + + if [ "$RELEASE" = "rec-43" ]; then + cat <> Dockerfile.$RELEASE.$OS-$VERSION + +RUN mkdir /var/run/pdns-recursor +EOF + fi + + cat <> Dockerfile.$RELEASE.$OS-$VERSION CMD $CMD --version EOF } + write_debian() { write_debian_or_ubuntu debian $1 $2 $3 } + write_ubuntu() { write_debian_or_ubuntu ubuntu $1 $2 $3 } + RELEASE=$1 if [ "$RELEASE" = "auth-40" ]; then @@ -96,15 +127,7 @@ elif [ "$RELEASE" = "auth-41" ]; then write_ubuntu trusty pdns-server pdns_server write_ubuntu xenial pdns-server pdns_server write_ubuntu bionic pdns-server pdns_server -elif [ "$RELEASE" = "auth-42" ]; then - write_centos 6 pdns pdns_server - write_centos 7 pdns pdns_server - write_centos 8 pdns pdns_server - write_debian stretch pdns-server pdns_server - write_debian buster pdns-server pdns_server - write_ubuntu xenial pdns-server pdns_server - write_ubuntu bionic pdns-server pdns_server -elif [ "$RELEASE" = "auth-43" ]; then +elif [ "$RELEASE" = "auth-42" -o "$RELEASE" = "auth-43" ]; then write_centos 6 pdns pdns_server write_centos 7 pdns pdns_server write_centos 8 pdns pdns_server @@ -127,15 +150,7 @@ elif [ "$RELEASE" = "rec-41" ]; then write_ubuntu trusty pdns-recursor pdns_recursor write_ubuntu xenial pdns-recursor pdns_recursor write_ubuntu bionic pdns-recursor pdns_recursor -elif [ "$RELEASE" = "rec-42" ]; then - write_centos 6 pdns-recursor pdns_recursor - write_centos 7 pdns-recursor pdns_recursor - write_centos 8 pdns-recursor pdns_recursor - write_debian stretch pdns-recursor pdns_recursor - write_debian buster pdns-recursor pdns_recursor - write_ubuntu xenial pdns-recursor pdns_recursor - write_ubuntu bionic pdns-recursor pdns_recursor -elif [ "$RELEASE" = "rec-43" ]; then +elif [ "$RELEASE" = "rec-42" -o "$RELEASE" = "rec-43" ]; then write_centos 6 pdns-recursor pdns_recursor write_centos 7 pdns-recursor pdns_recursor write_centos 8 pdns-recursor pdns_recursor -- 2.47.2