Update .gitlab-ci.yml file

This commit is contained in:
Adrien Bourmault 2022-10-11 22:57:52 +00:00
parent 706c2c5052
commit 73111c21a2
1 changed files with 9 additions and 7 deletions

View File

@ -36,8 +36,11 @@ test-job: # This job runs in the test stage.
for file in $files
do
domain=$(echo $file | sed "s/.zone//g")
/usr/sbin/named-checkzone "$domain" "$file"
if [[ "$file" =~ .*"zone".* ]]
then
domain=$(echo $file | sed "s/.zone//g")
/usr/sbin/named-checkzone "$domain" "$file" || exit 2
fi
done
else
echo "Pas de fichier de zone à tester"
@ -49,11 +52,10 @@ deploy-job: # This job runs in the deploy stage.
script:
- |+
echo Recherche de zones à déployer
if [ ! -z "$CI_RELOAD" ]
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)
else
files=$(git diff-tree --no-commit-id --name-only -r $CI_COMMIT_SHA)
files=$(find . -name "*.zone" -printf "%P ")
fi
- echo "Déploiement des zones $files..."