Merge branch 'master' of git.a-lec.org:a-lec/commissions/infrastructure/www

This commit is contained in:
Christian P. MOMON 2022-08-14 01:44:51 +02:00
commit 6c3bad8a01
2 changed files with 32 additions and 14 deletions

View File

@ -20,26 +20,44 @@ stages: # List of stages for jobs, and their order of execution
synchro-et-tests: synchro-et-tests:
stage: build stage: build
script: script:
- rsync -avzlh * /home/webmaster/articles/ --delete - rsync -avzlh * /home/webmaster/site-a-lec.org/articles/
- 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/ 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 | grep stl || ls *.stl)
- files=(git diff-tree --no-commit-id --name-only -r $CI_COMMIT_SHA) - cd /home/webmaster/site-a-lec.org
- cd /home/webmaster/articles - |+
- gsl check errors=0
- test -z "$(gsl check | grep Err)" for file in $files
- gsl sync wip 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. deploiement: # This job runs in the deploy stage.
stage: deploy # It only runs when *both* jobs in the test stage complete successfully. stage: deploy # It only runs when *both* jobs in the test stage complete successfully.
script: 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 do
echo "Construction de $postfile" echo "Construction de $file"
gsl make $postfile stl log clean
test -z "$(gsl make $postfile | grep Err)" 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 done
[ $errors -gt 0 ] && false
- echo "Déploiement terminé." - echo "Déploiement terminé."

View File