Update .gitlab-ci.yml file

This commit is contained in:
Adrien Bourmault 2022-08-14 09:34:29 +00:00
parent 9647510783
commit 4190ef4a8c
1 changed files with 11 additions and 2 deletions

View File

@ -20,12 +20,18 @@ stages: # List of stages for jobs, and their order of execution
synchro-et-tests:
stage: build
script:
- rsync -avzlh * /home/webmaster/site-chalec.org/articles/
- |+
# Sync files
rsync -avzlh * /home/webmaster/site-chalec.org/articles/
- |+
# Check how many changed
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
echo -e "Test de : \n $files"
- cd /home/webmaster/site-chalec.org
- |+
# Test for errors
errors=0
for file in $files
do
@ -48,10 +54,13 @@ 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
files=""
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 | grep stl || find . -name "*.stl")
if [ -z "$CI_COMMIT_SHA" ]; then files=$(find . -name "*.stl"); fi
- cd /home/webmaster/site-chalec.org
- |+
# Build and check for errors
errors=0
for file in $files
do