]>
Commit | Line | Data |
---|---|---|
b0a5f835 EW |
1 | #!/bin/sh |
2 | # | |
3 | # - `docker build --no-cache --pull --file Dockerfile.auth-41.ubuntu-bionic --tag auth-41.ubuntu-bionic .` | |
4 | # - `docker run -it auth-41.ubuntu-bionic` | |
5 | # - `docker run -it auth-41.ubuntu-bionic /bin/bash` | |
6 | # - `pdns_recursor` | |
7 | ||
8 | if [ "$1" = "" -o "$1" = "-?" -o "$1" = "-h" -o "$1" = "--help" ]; then | |
9 | echo "Usage: generate-repo-files.sh RELEASE" | |
10 | echo | |
11 | echo " • RELEASE: [ auth-40 | auth-41 | auth-42 | rec-40 | rec-41 | rec-42 ]" | |
12 | exit 1 | |
13 | fi | |
14 | ||
15 | write_centos() | |
16 | { | |
17 | OS=centos | |
18 | VERSION=$1 | |
19 | PKG=$2 | |
20 | CMD=$3 | |
21 | cat <<EOF > Dockerfile.$RELEASE.$OS-$VERSION | |
22 | FROM $OS:$VERSION | |
23 | ||
24 | RUN yum install -y epel-release yum-plugin-priorities | |
25 | RUN curl -o /etc/yum.repos.d/powerdns-$RELEASE.repo https://repo.powerdns.com/repo-files/$OS-$RELEASE.repo | |
26 | RUN yum install -y $PKG | |
27 | ||
28 | CMD $CMD --version | |
29 | EOF | |
30 | } | |
31 | ||
32 | write_debian_or_ubuntu() | |
33 | { | |
34 | OS=$1 | |
35 | VERSION=$2 | |
36 | PKG=$3 | |
37 | CMD=$4 | |
38 | cat <<EOF > pdns.list.$RELEASE.$OS-$VERSION | |
39 | deb [arch=amd64] http://repo.powerdns.com/$OS $VERSION-$RELEASE main | |
40 | EOF | |
41 | # if not exists | |
42 | cat <<EOF > pdns.debian-and-ubuntu | |
43 | Package: pdns-* | |
44 | Pin: origin repo.powerdns.com | |
45 | Pin-Priority: 600 | |
46 | EOF | |
47 | cat <<EOF > Dockerfile.$RELEASE.$OS-$VERSION | |
48 | FROM $OS:$VERSION | |
49 | ||
50 | RUN apt-get update | |
51 | RUN apt-get install -y curl gnupg | |
52 | ||
53 | COPY pdns.debian-and-ubuntu /etc/apt/preferences.d/pdns | |
54 | COPY pdns.list.$RELEASE.$OS-$VERSION /etc/apt/sources.list.d/pdns.list | |
55 | ||
56 | RUN curl https://repo.powerdns.com/FD380FBB-pub.asc | apt-key add - | |
57 | RUN apt-get update | |
58 | RUN apt-get install -y $PKG | |
59 | ||
60 | CMD $CMD --version | |
61 | EOF | |
62 | } | |
63 | ||
64 | write_debian() | |
65 | { | |
66 | write_debian_or_ubuntu debian $1 $2 $3 | |
67 | } | |
68 | ||
69 | write_ubuntu() | |
70 | { | |
71 | write_debian_or_ubuntu ubuntu $1 $2 $3 | |
72 | } | |
73 | ||
74 | RELEASE=$1 | |
75 | ||
76 | if [ "$RELEASE" = "auth-40" ]; then | |
77 | write_centos 6 pdns pdns_server | |
78 | write_centos 7 pdns pdns_server | |
79 | write_debian jessie pdns-server pdns_server | |
80 | write_debian stretch pdns-server pdns_server | |
81 | write_ubuntu trusty pdns-server pdns_server | |
82 | write_ubuntu xenial pdns-server pdns_server | |
83 | elif [ "$RELEASE" = "auth-41" ]; then | |
84 | write_centos 6 pdns pdns_server | |
85 | write_centos 7 pdns pdns_server | |
86 | write_debian jessie pdns-server pdns_server | |
87 | write_debian stretch pdns-server pdns_server | |
88 | write_ubuntu trusty pdns-server pdns_server | |
89 | write_ubuntu xenial pdns-server pdns_server | |
90 | write_ubuntu bionic pdns-server pdns_server | |
91 | elif [ "$RELEASE" = "auth-42" ]; then | |
92 | write_centos 6 pdns pdns_server | |
93 | write_centos 7 pdns pdns_server | |
94 | write_debian jessie pdns-server pdns_server | |
95 | write_debian stretch pdns-server pdns_server | |
96 | write_ubuntu trusty pdns-server pdns_server | |
97 | write_ubuntu xenial pdns-server pdns_server | |
98 | write_ubuntu bionic pdns-server pdns_server | |
99 | write_ubuntu cosmic pdns-server pdns_server | |
100 | elif [ "$RELEASE" = "rec-40" ]; then | |
101 | write_centos 6 pdns-recursor pdns_recursor | |
102 | write_centos 7 pdns-recursor pdns_recursor | |
103 | write_debian jessie pdns-recursor pdns_recursor | |
104 | write_debian stretch pdns-recursor pdns_recursor | |
105 | write_ubuntu trusty pdns-recursor pdns_recursor | |
106 | write_ubuntu xenial pdns-recursor pdns_recursor | |
107 | elif [ "$RELEASE" = "rec-41" ]; then | |
108 | write_centos 6 pdns-recursor pdns_recursor | |
109 | write_centos 7 pdns-recursor pdns_recursor | |
110 | write_debian jessie pdns-recursor pdns_recursor | |
111 | write_debian stretch pdns-recursor pdns_recursor | |
112 | write_ubuntu trusty pdns-recursor pdns_recursor | |
113 | write_ubuntu xenial pdns-recursor pdns_recursor | |
114 | write_ubuntu bionic pdns-recursor pdns_recursor | |
115 | elif [ "$RELEASE" = "rec-42" ]; then | |
116 | write_centos 6 pdns-recursor pdns_recursor | |
117 | write_centos 7 pdns-recursor pdns_recursor | |
118 | write_debian jessie pdns-recursor pdns_recursor | |
119 | write_debian stretch pdns-recursor pdns_recursor | |
120 | write_debian buster pdns-recursor pdns_recursor | |
121 | write_ubuntu trusty pdns-recursor pdns_recursor | |
122 | write_ubuntu xenial pdns-recursor pdns_recursor | |
123 | write_ubuntu bionic pdns-recursor pdns_recursor | |
124 | write_ubuntu cosmic pdns-recursor pdns_recursor | |
125 | else | |
126 | echo "Invalid release: $RELEASE" | |
127 | exit 1 | |
128 | fi |