Update .gitlab-ci.yml file
This commit is contained in:
parent
559abb6115
commit
8b11f16e18
|
@ -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-chalec.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é."
|
||||
|
|
Loading…
Reference in New Issue