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:
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é."

View File