Compare commits
3 Commits
4e11191eeb
...
2ed8ae1978
Author | SHA1 | Date | |
---|---|---|---|
2ed8ae1978 | |||
67a4f2b02e | |||
7d6169a8a0 |
61
.drone.yml
Normal file
61
.drone.yml
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
kind: pipeline
|
||||||
|
name: default
|
||||||
|
type: docker
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: build
|
||||||
|
image: docker:dind
|
||||||
|
volumes:
|
||||||
|
- name: dockersock
|
||||||
|
path: /var/run
|
||||||
|
environment:
|
||||||
|
DOCKER_USERNAME:
|
||||||
|
from_secret: docker_username
|
||||||
|
DOCKER_PASSWORD:
|
||||||
|
from_secret: docker_password
|
||||||
|
commands:
|
||||||
|
- sleep 5 # give docker enough time to start
|
||||||
|
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
|
||||||
|
- ./debian/11/build.sh
|
||||||
|
- ./debian/12/build.sh
|
||||||
|
when:
|
||||||
|
branch:
|
||||||
|
- master
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
|
||||||
|
- name: rebuild
|
||||||
|
image: docker:dind
|
||||||
|
volumes:
|
||||||
|
- name: dockersock
|
||||||
|
path: /var/run
|
||||||
|
environment:
|
||||||
|
DOCKER_USERNAME:
|
||||||
|
from_secret: docker_username
|
||||||
|
DOCKER_PASSWORD:
|
||||||
|
from_secret: docker_password
|
||||||
|
commands:
|
||||||
|
- sleep 5 # give docker enough time to start
|
||||||
|
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
|
||||||
|
- ./build/rebuild.sh
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
- cron
|
||||||
|
|
||||||
|
services:
|
||||||
|
- name: docker
|
||||||
|
image: docker:dind
|
||||||
|
privileged: true
|
||||||
|
volumes:
|
||||||
|
- name: dockersock
|
||||||
|
path: /var/run
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- name: dockersock
|
||||||
|
temp: {}
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
branch:
|
||||||
|
- master
|
||||||
|
event:
|
||||||
|
- push
|
18
build/rebuild.sh
Executable file
18
build/rebuild.sh
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
updates_available () {
|
||||||
|
docker pull $1
|
||||||
|
if test "$(docker run -it --rm $1 /bin/sh -c 'apt -qqq update && apt -qq list --upgradable')" != ""; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
if updates_available pommib/powerdns:4.4-bullseye; then
|
||||||
|
./debian/11/build.sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
if updates_available pommib/powerdns:4.6-bookworm; then
|
||||||
|
./debian/12/build.sh
|
||||||
|
fi
|
1
debian/11/Dockerfile
vendored
1
debian/11/Dockerfile
vendored
@ -2,6 +2,7 @@ FROM debian:bullseye-slim
|
|||||||
|
|
||||||
RUN set -eux; \
|
RUN set -eux; \
|
||||||
apt-get update; \
|
apt-get update; \
|
||||||
|
apt-get upgrade -y; \
|
||||||
apt-get install -y --no-install-recommends \
|
apt-get install -y --no-install-recommends \
|
||||||
pdns-server \
|
pdns-server \
|
||||||
pdns-backend-bind \
|
pdns-backend-bind \
|
||||||
|
9
debian/11/build.sh
vendored
Executable file
9
debian/11/build.sh
vendored
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
IMAGE=pommib/powerdns:4.4-bullseye
|
||||||
|
docker pull $IMAGE
|
||||||
|
docker pull debian:bullseye-slim
|
||||||
|
docker build --no-cache -t $IMAGE ./debian/11/
|
||||||
|
docker push $IMAGE
|
2
debian/11/start.sh
vendored
2
debian/11/start.sh
vendored
@ -11,7 +11,7 @@ sed -i 's/^# bind-dnssec-db=/bind-dnssec-db=\/var\/lib\/powerdns\/bind-dnssec-db
|
|||||||
/usr/sbin/pdns_server --guardian=no --daemon=no --disable-syslog --log-timestamp=no --write-pid=no &
|
/usr/sbin/pdns_server --guardian=no --daemon=no --disable-syslog --log-timestamp=no --write-pid=no &
|
||||||
|
|
||||||
# watch for zone changes
|
# watch for zone changes
|
||||||
inotifywait -mqre modify --exclude '\.git' --format '%w%f' "/var/lib/powerdns/zones/" |
|
inotifywait -mqre modify --exclude '\.git' --exclude '.*\.swp' --format '%w%f' "/var/lib/powerdns/zones/" |
|
||||||
while read -r path; do
|
while read -r path; do
|
||||||
zone=$(basename $path)
|
zone=$(basename $path)
|
||||||
echo [$0] A modification was detected in $path
|
echo [$0] A modification was detected in $path
|
||||||
|
1
debian/12/Dockerfile
vendored
1
debian/12/Dockerfile
vendored
@ -2,6 +2,7 @@ FROM debian:bookworm-slim
|
|||||||
|
|
||||||
RUN set -eux; \
|
RUN set -eux; \
|
||||||
apt-get update; \
|
apt-get update; \
|
||||||
|
apt-get upgrade -y; \
|
||||||
apt-get install -y --no-install-recommends \
|
apt-get install -y --no-install-recommends \
|
||||||
pdns-server \
|
pdns-server \
|
||||||
pdns-backend-bind \
|
pdns-backend-bind \
|
||||||
|
12
debian/12/build.sh
vendored
Executable file
12
debian/12/build.sh
vendored
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
IMAGE=pommib/powerdns:4.6-bookworm
|
||||||
|
docker pull $IMAGE
|
||||||
|
docker pull debian:bookworm-slim
|
||||||
|
docker build --no-cache -t $IMAGE ./debian/12/
|
||||||
|
docker push $IMAGE
|
||||||
|
|
||||||
|
docker tag $IMAGE pommib/powerdns:latest
|
||||||
|
docker push pommib/powerdns:latest
|
2
debian/12/start.sh
vendored
2
debian/12/start.sh
vendored
@ -11,7 +11,7 @@ sed -i 's/^# bind-dnssec-db=/bind-dnssec-db=\/var\/lib\/powerdns\/bind-dnssec-db
|
|||||||
/usr/sbin/pdns_server --guardian=no --daemon=no --disable-syslog --log-timestamp=no --write-pid=no &
|
/usr/sbin/pdns_server --guardian=no --daemon=no --disable-syslog --log-timestamp=no --write-pid=no &
|
||||||
|
|
||||||
# watch for zone changes
|
# watch for zone changes
|
||||||
inotifywait -mqre modify --exclude '\.git' --format '%w%f' "/var/lib/powerdns/zones/" |
|
inotifywait -mqre modify --exclude '\.git' --exclude '.*\.swp' --format '%w%f' "/var/lib/powerdns/zones/" |
|
||||||
while read -r path; do
|
while read -r path; do
|
||||||
zone=$(basename $path)
|
zone=$(basename $path)
|
||||||
echo [$0] A modification was detected in $path
|
echo [$0] A modification was detected in $path
|
||||||
|
Loading…
Reference in New Issue
Block a user