.forgejo/workflows/ci.yaml: WIP, preparing for nsupdate
/ deploy_script (push) Successful in 1s Details

This commit is contained in:
Adrien Bourmault 2024-08-20 16:29:15 +02:00
parent b0a4b35a2a
commit ca4f15b67b
Signed by: neox
GPG Key ID: 57BC26A3687116F6
1 changed files with 20 additions and 19 deletions

View File

@ -9,34 +9,35 @@ jobs:
steps: steps:
- name: Reload bind - name: Reload bind
shell: bash shell: bash
run: git diff HEAD^ HEAD > zone_diff.txt run: echo OK
while IFS= read -r line; do # run: git diff HEAD^ HEAD > zone_diff.txt
case "$line" in # while IFS= read -r line; do
"--- "*".zone") # case "$line" in
CURRENT_ZONE=$(basename "$line" .zone | sed 's/--- //') # "--- "*".zone")
;; # CURRENT_ZONE=$(basename "$line" .zone | sed 's/--- //')
"+++"*) # ;;
;; # "+++"*)
"-"* | "+"*) # ;;
if [[ $line == -* ]]; then # Enregistrement supprimé # "-"* | "+"*)
RECORD=$(echo "$line" | sed 's/^-//') # if [[ $line == -* ]]; then # Enregistrement supprimé
echo - $RECORD # RECORD=$(echo "$line" | sed 's/^-//')
# echo - $RECORD
# echo nsupdate -k $TSIG_KEY <<EOF # echo nsupdate -k $TSIG_KEY <<EOF
# server $DNS_SERVER # server $DNS_SERVER
# zone $CURRENT_ZONE # zone $CURRENT_ZONE
# update delete $RECORD # update delete $RECORD
# send # send
# EOF # EOF
elif [[ $line == +* ]]; then # Enregistrement ajouté # elif [[ $line == +* ]]; then # Enregistrement ajouté
RECORD=$(echo "$line" | sed 's/^+//') # RECORD=$(echo "$line" | sed 's/^+//')
echo + $RECORD # echo + $RECORD
# nsupdate -k $TSIG_KEY <<EOF # nsupdate -k $TSIG_KEY <<EOF
# server $DNS_SERVER # server $DNS_SERVER
# zone $CURRENT_ZONE # zone $CURRENT_ZONE
# update add $RECORD # update add $RECORD
# send # send
# EOF # EOF
fi # fi
;; # ;;
esac # esac
done < zone_diff.txt # done < zone_diff.txt