.forgejo/workflows/ci.yaml: correcting error
/ deploy_script (push) Successful in 2s Details

This commit is contained in:
Adrien Bourmault 2024-08-20 18:00:55 +02:00
parent ded4e7c889
commit 24ce431ae0
Signed by: neox
GPG Key ID: 57BC26A3687116F6
1 changed files with 5 additions and 3 deletions

View File

@ -15,6 +15,7 @@ jobs:
git clone ${{ gitea.server_url }}/${{ gitea.repository }} dns
cd dns
git diff HEAD^ HEAD > zone_diff.txt
echo "${{ secrets.TSIG_KEY }}" > temp_keyfile
while IFS= read -r line; do
case "$line" in
"--- "*".zone")
@ -33,16 +34,17 @@ jobs:
RECORD=$(echo "$line" | sed 's/^-//')
echo "update delete $RECORD"
echo -e "server $DNS_SERVER\nupdate delete $RECORD\nsend" > temp_delete
nsupdate -k "${{ secrets.TSIG_KEY }}" temp_delete
nsupdate -k temp_keyfile temp_delete
rm temp_delete
elif [[ $line == +* ]]; then # Enregistrement ajouté
RECORD=$(echo "$line" | sed 's/^+//')
echo "+ $RECORD"
echo -e "server $DNS_SERVER\nupdate add $RECORD\nsend" > temp_add
nsupdate -k "${{ secrets.TSIG_KEY }}" temp_add
nsupdate -k temp_keyfile temp_add
rm temp_add
fi
fi
;;
esac
done < zone_diff.txt
rm temp_keyfile