Actualiser .forgejo/workflows/ci.yaml
/ deploiement (push) Has been skipped Details
/ sync (push) Failing after 1s Details

This commit is contained in:
Adrien Bourmault 2023-11-30 18:26:23 +01:00
parent 1e2ff6d69d
commit 0d64f57cdf
1 changed files with 7 additions and 29 deletions

View File

@ -4,48 +4,26 @@ on:
- 'main' - 'main'
jobs: jobs:
tests: sync:
runs-on: linux_amd64 runs-on: linux_amd64
steps: steps:
- name: Retrieve files - name: Retrieve and sync files
shell: bash shell: bash
run: | run: |
git clone ${{ gitea.server_url }}/${{ gitea.repository }} dns git clone ${{ gitea.server_url }}/${{ gitea.repository }} dns
echo "Cloned sucessfully from ${{ gitea.server_url }}/${{ gitea.repository }}" echo "Cloned sucessfully from ${{ gitea.server_url }}/${{ gitea.repository }}"
- name: Test files
shell: bash
run: |
cd dns
files=$(git diff-tree --no-commit-id --name-only -r main | grep "*.zone") files=$(git diff-tree --no-commit-id --name-only -r main | grep "*.zone")
echo "Have to test $files" echo "Have to test $files"
echo "" > /var/cache/bind/.modified
for file in $files for file in $files
do do
domain=$(echo $file | sed "s/.zone//g") domain=$(echo $file | sed "s/.zone//g")
/usr/sbin/named-checkzone "$domain" "$file" || echo "Error on file $file" && exit 2 /usr/sbin/named-checkzone "$domain" "$file" || echo "Error on file $file" && continue
done echo "$file" >> /var/cache/bind/.modified
echo $(git diff-tree --no-commit-id --name-only -r main | grep "*.zone") > /var/cache/bind/.modified
echo "Tested sucessfully"
sync:
runs-on: linux_amd64
needs: tests
steps:
- name: Retrieve files
shell: bash
run: |
git clone ${{ gitea.server_url }}/${{ gitea.repository }} dns
- name: Sync files
shell: bash
run: |
cd dns
files=$(cat /var/cache/bind/.modified)
if [ -z "$files" ]; then
files=$(find . -name "*.zone" -printf %P)
fi
for file in $files
do
cp -f "$file" "/var/cache/bind/$file" cp -f "$file" "/var/cache/bind/$file"
done done
echo "Synced sucessfully"
deploiement: deploiement:
runs-on: linux_amd64 runs-on: linux_amd64