From 796934df00bf0177607523d9822ef7c24ec1d93d Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Fri, 12 Aug 2022 15:57:24 +0000 Subject: [PATCH 1/5] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bd7a993..eb1eeaf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,7 +21,9 @@ synchro-et-tests: stage: build script: - rsync -avzlh * /home/webmaster/site-chalec.org/articles/ - - files=$(git diff-tree --no-commit-id --name-only -r $CI_COMMIT_SHA|grep stl || ls *.stl) + - |+ + 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= @@ -39,7 +41,9 @@ synchro-et-tests: deploiement: # This job runs in the deploy stage. stage: deploy # It only runs when *both* jobs in the test stage complete successfully. script: - - files=$(git diff-tree --no-commit-id --name-only -r $CI_COMMIT_SHA|grep stl || ls *.stl) + - |+ + 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= From cdf7a1c81e5631362d6c07544f182d4ac2a3cc84 Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Fri, 12 Aug 2022 15:58:56 +0000 Subject: [PATCH 2/5] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index eb1eeaf..0a1b54b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,11 +22,11 @@ synchro-et-tests: script: - rsync -avzlh * /home/webmaster/site-chalec.org/articles/ - |+ - files= + 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= + errors="" for file in $files do echo "Test de $file" @@ -42,11 +42,11 @@ deploiement: # This job runs in the deploy stage. stage: deploy # It only runs when *both* jobs in the test stage complete successfully. script: - |+ - files= + 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= + errors="" for file in $files do echo "Construction de $file" From c3fa2c302d9df28b511085397f9d186f70e8a356 Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Fri, 12 Aug 2022 16:02:36 +0000 Subject: [PATCH 3/5] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) 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 From 29bf71bed5d41adfdb3faf4f30c385daa378aab4 Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Fri, 12 Aug 2022 16:04:49 +0000 Subject: [PATCH 4/5] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f18ba92..39b3592 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -32,7 +32,7 @@ synchro-et-tests: echo "Test de $file" stl check $file | grep Err && errors=$((errors+1)) # error if err is read in standard output done - test [ err -gt 0 ] && false + [ $err -gt 0 ] && false - echo "Fin des tests." @@ -50,6 +50,6 @@ deploiement: # This job runs in the deploy stage. echo "Construction de $file" stl wip $file | grep Err && errors=$((errors+1)) # error if err is read in standard output done - test [ err -gt 0 ] && false + [ $err -gt 0 ] && false - stl sync - echo "Déploiement terminé." \ No newline at end of file From 5403445a9175a0c2c2933d07d23b0fa2b068363f Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Fri, 12 Aug 2022 16:05:28 +0000 Subject: [PATCH 5/5] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 39b3592..1573327 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -32,7 +32,7 @@ synchro-et-tests: echo "Test de $file" stl check $file | grep Err && errors=$((errors+1)) # error if err is read in standard output done - [ $err -gt 0 ] && false + [ $errors -gt 0 ] && false - echo "Fin des tests." @@ -50,6 +50,6 @@ deploiement: # This job runs in the deploy stage. echo "Construction de $file" stl wip $file | grep Err && errors=$((errors+1)) # error if err is read in standard output done - [ $err -gt 0 ] && false + [ $errors -gt 0 ] && false - stl sync - echo "Déploiement terminé." \ No newline at end of file