From 088d030fe81f53478476dea5e0a2e8da54c7a666 Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Sun, 14 Aug 2022 11:15:07 +0000 Subject: [PATCH] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0858588..4259703 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,14 +21,19 @@ synchro-et-tests: stage: build script: - |+ - # Sync files + # Sync files with server rsync -avzlh * /home/webmaster/site-chalec.org/articles/ - |+ # Check how many changed + echo "Fichiers commités : $(git diff-tree --no-commit-id --name-only -r $CI_COMMIT_SHA)" files="" - files=$(git diff-tree --no-commit-id --name-only -r $CI_COMMIT_SHA | grep stl || find . -name "*.stl") - if [ -z "$CI_COMMIT_SHA" ]; then files=$(find . -name "*.stl"); fi + if [ -z "$CI_COMMIT_SHA" ]; then + files=$(find . -name "*.stl" -printf %P) + else + files=$(git diff-tree --no-commit-id --name-only -r $CI_COMMIT_SHA | grep stl || find . -name "*.stl" -printf "%P\n") + fi echo -e "Test de : \n $files" + - cd /home/webmaster/site-chalec.org - |+ # Test for errors @@ -54,10 +59,15 @@ deploiement: # This job runs in the deploy stage. stage: deploy # It only runs when *both* jobs in the test stage complete successfully. script: - |+ - # Check how many files to be builded + # Check how many changed + echo "Fichiers commités : $(git diff-tree --no-commit-id --name-only -r $CI_COMMIT_SHA)" files="" - files=$(git diff-tree --no-commit-id --name-only -r $CI_COMMIT_SHA | grep stl || find . -name "*.stl") - if [ -z "$CI_COMMIT_SHA" ]; then files=$(find . -name "*.stl"); fi + if [ -z "$CI_COMMIT_SHA" ] ; then + files=$(find . -name "*.stl" -printf %P) + else + files=$(git diff-tree --no-commit-id --name-only -r $CI_COMMIT_SHA | grep stl || find . -name "*.stl" -printf "%P\n") + fi + echo -e "Test de : \n $files" - cd /home/webmaster/site-chalec.org - |+ # Build and check for errors