.forgejo/workflows/ci.yaml: WIP
/ deploy_script (push) Failing after 1s Details

This commit is contained in:
Adrien Bourmault 2024-08-20 17:19:18 +02:00
parent 77e8d9e19f
commit 181dcc78af
Signed by: neox
GPG Key ID: 57BC26A3687116F6
1 changed files with 22 additions and 19 deletions

View File

@ -8,37 +8,40 @@ jobs:
runs-on: linux_amd64
steps:
- name: Apply zone changes
uses: https://code.forgejo.org/actions/checkout@v4
shell: bash
run: |
echo "Preparing to update ${{ vars.DNS_SERVER }}..."
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 $(git diff HEAD^ HEAD)
echo $(git diff HEAD)
# 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"
# 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"
# 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
# fi
# ;;
# esac
# done < zone_diff.txt