44 lines
1.7 KiB
YAML
44 lines
1.7 KiB
YAML
on:
|
|
push:
|
|
branches:
|
|
- 'main'
|
|
|
|
jobs:
|
|
deploy_script:
|
|
runs-on: linux_amd64
|
|
steps:
|
|
- name: Apply zone changes
|
|
shell: bash
|
|
run: echo "Preparing to update ${{ vars.DNS_SERVER }}..."
|
|
echo "Finished."
|
|
# run: git diff HEAD^ HEAD > zone_diff.txt
|
|
# while IFS= read -r line; do
|
|
# case "$line" in
|
|
# "--- "*".zone")
|
|
# CURRENT_ZONE=$(basename "$line" .zone | sed 's/--- //')
|
|
# ;;
|
|
# "+++"*)
|
|
# ;;
|
|
# "-"* | "+"*)
|
|
# if [[ $line == -* ]]; then # Enregistrement supprimé
|
|
# RECORD=$(echo "$line" | sed 's/^-//')
|
|
# echo - $RECORD
|
|
# echo nsupdate -k $TSIG_KEY <<EOF
|
|
# server $DNS_SERVER
|
|
# zone $CURRENT_ZONE
|
|
# update delete $RECORD
|
|
# send
|
|
# EOF
|
|
# elif [[ $line == +* ]]; then # Enregistrement ajouté
|
|
# RECORD=$(echo "$line" | sed 's/^+//')
|
|
# echo + $RECORD
|
|
# nsupdate -k $TSIG_KEY <<EOF
|
|
# server $DNS_SERVER
|
|
# zone $CURRENT_ZONE
|
|
# update add $RECORD
|
|
# send
|
|
# EOF
|
|
# fi
|
|
# ;;
|
|
# esac
|
|
# done < zone_diff.txt |