2021-07-29 20:57:24 +00:00
|
|
|
image: debian:stable-slim
|
2021-06-07 16:24:09 +00:00
|
|
|
|
|
|
|
before_script:
|
2021-07-29 20:57:24 +00:00
|
|
|
- apt-get update
|
|
|
|
- apt-get install -y ssh-client
|
2021-06-07 16:24:09 +00:00
|
|
|
# from https://docs.gitlab.com/ee/ci/ssh_keys/
|
|
|
|
- eval $(ssh-agent -s)
|
|
|
|
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
|
2021-07-29 20:57:24 +00:00
|
|
|
- mkdir -p $HOME/.ssh
|
|
|
|
- chmod 700 $HOME/.ssh
|
|
|
|
- echo "$SSH_KNOWN_HOSTS" >> $HOME/.ssh/known_hosts
|
|
|
|
- chmod 644 $HOME/.ssh/known_hosts
|
2021-06-07 16:26:02 +00:00
|
|
|
|
2021-06-07 16:44:28 +00:00
|
|
|
deploy:
|
2021-06-07 16:26:02 +00:00
|
|
|
script:
|
2021-07-29 20:57:24 +00:00
|
|
|
- |
|
|
|
|
for zonefile in zones/*; do
|
|
|
|
zone=$(basename $zonefile)
|
|
|
|
echo $(echo -n $zone | sha1sum | cut -f1 -d' ').zones 0 IN PTR $zone. >> catalog-zone/dns-witch-catalog.zone
|
|
|
|
done
|
2021-07-29 20:58:52 +00:00
|
|
|
- '[ -n "$(git diff --name-only HEAD~ zones)" ] && scp $(git diff --name-only HEAD~ zones) ${SSH_PRIMARY_NS}:/var/lib/knot/zones'
|
2021-07-29 20:57:24 +00:00
|
|
|
- scp catalog-zones ${SSH_PRIMARY_NS}:/var/lib/knot
|
|
|
|
- ssh ${SSH_PRIMARY_NS} 'chown -R knot:knot /var/lib/knot/{zones,catalog-zones} && knotc reload'
|