diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3d16eab..4a5457c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,26 +20,44 @@ stages: # List of stages for jobs, and their order of execution synchro-et-tests: stage: build script: - - rsync -avzlh * /home/webmaster/articles/ --delete - - mkdir -p /var/lib/gsl/domains/a-lec.org/files/ /var/lib/gsl/domains/a-lec.org/images - - rsync -avzlh fichiers/ /var/lib/gsl/domains/a-lec.org/files/ - - rsync -avzlh images/ /var/lib/gsl/domains/a-lec.org/images/ - - files=(git diff-tree --no-commit-id --name-only -r $CI_COMMIT_SHA) - - cd /home/webmaster/articles - - gsl check - - test -z "$(gsl check | grep Err)" - - gsl sync wip + - rsync -avzlh * /home/webmaster/site-a-lec.org/articles/ + - |+ + files="" + files=$(git diff-tree --no-commit-id --name-only -r $CI_COMMIT_SHA | grep stl || ls *.stl) + - cd /home/webmaster/site-a-lec.org + - |+ + errors=0 + for file in $files + do + echo "Test de $file" + stl log clean + stl check $file | grep -e "Err" -e "erreur de" -e "Aucun fichier" && errors=$((errors+1)) # error if err is read in standard output + done + [ $errors -gt 0 ] && false + for file in $files + do + echo "Test supplémentaire de $file" + stl log clean + stl check -F $file &> /dev/null + stl check -F $file &> /dev/null + done + - echo "Fin des tests." deploiement: # This job runs in the deploy stage. stage: deploy # It only runs when *both* jobs in the test stage complete successfully. script: - - cd /home/webmaster/articles - |+ - for postfile in $(ls *.gsl) + files="" + files=$(git diff-tree --no-commit-id --name-only -r $CI_COMMIT_SHA | grep stl || ls *.stl) + - cd /home/webmaster/site-a-lec.org + - |+ + errors=0 + for file in $files do - echo "Construction de $postfile" - gsl make $postfile - test -z "$(gsl make $postfile | grep Err)" + echo "Construction de $file" + stl log clean + stl wip -F $file | grep -e "Err" -e "erreur de" -e "Aucun fichier" && errors=$((errors+1)) # error if err is read in standard output done + [ $errors -gt 0 ] && false - echo "Déploiement terminé." diff --git a/fichiers/.gitkeep b/fichiers/.gitkeep deleted file mode 100644 index e69de29..0000000