diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0a1b54b..f18ba92 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,15 +26,13 @@ synchro-et-tests: files=$(git diff-tree --no-commit-id --name-only -r $CI_COMMIT_SHA | grep stl || ls *.stl) - cd /home/webmaster/site-chalec.org - |+ - errors="" + errors=0 for file in $files do echo "Test de $file" - stl check $file - errors=$errors"\n"$(stl check $file | grep Err) # return false if error is read in standard output + stl check $file | grep Err && errors=$((errors+1)) # error if err is read in standard output done - echo "Récapitulatif des erreurs" - echo -e $errors | grep Err && false + test [ err -gt 0 ] && false - echo "Fin des tests." @@ -50,10 +48,8 @@ deploiement: # This job runs in the deploy stage. for file in $files do echo "Construction de $file" - stl wip $file - errors=$errors"\n"$(stl wip $file | grep Err) # return false if error is read in standard output + stl wip $file | grep Err && errors=$((errors+1)) # error if err is read in standard output done - echo "Récapitulatif des erreurs" - echo -e $errors | grep Err && false + test [ err -gt 0 ] && false - stl sync - echo "Déploiement terminé." \ No newline at end of file