Actualiser .forgejo/workflows/ci.yaml
This commit is contained in:
parent
1e2ff6d69d
commit
0d64f57cdf
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue