Update .gitlab-ci.yml file

This commit is contained in:
Adrien Bourmault 2022-10-12 13:00:37 +00:00
parent 73111c21a2
commit 862bf2e4ac
1 changed files with 23 additions and 0 deletions

View File

@ -19,6 +19,7 @@
stages: # List of stages for jobs, and their order of execution
- test
- deploy
- check
test-job: # This job runs in the test stage.
stage: test # It only starts when the job in the build stage completes successfully.
@ -69,3 +70,25 @@ deploy-job: # This job runs in the deploy stage.
done
sudo systemctl reload bind9.service
- echo "Déploiement terminé."
check-job: # This job runs in the deploy stage.
stage: check # It only runs when *both* jobs in the test stage complete successfully.
script:
- |+
echo Recherche de zones déployées
files=$(git diff-tree --no-commit-id --name-only -r $CI_COMMIT_SHA)
if [[ ! -z "$CI_RELOAD" || "$files" =~ .*"gitlab-ci.yml".* ]]
then
files=$(find . -name "*.zone" -printf "%P ")
fi
count=$(echo $files | wc -w)
linecount=$(( count * 3 + 3))
- echo "Vérification des zones $files..."
- sudo grep named /var/log/syslog | tail -n $linecount | grep "reloading configuration succeeded" || exit 4
- sudo grep named /var/log/syslog | tail -n $linecount | grep "reloading zones succeeded" || exit 5
- sudo grep named /var/log/syslog | tail -n $linecount | grep "all zones loaded" || exit 6
- sudo grep named /var/log/syslog | tail -n $linecount | grep "running" || exit 7
- echo "Déploiement terminé."