Attempt to filter folders

This commit is contained in:
ac
2023-12-30 16:26:20 +10:00
parent 34a61a970f
commit accd10e804

View File

@@ -38,36 +38,45 @@ image:
get_dirs:
- FILES=$(find . -name *$SEARCH -not -path "./.gitlab/*")
- |
if [[ $FILES == "" ]]; then
DIRS=""
else
DIRS=$(dirname $FILES)
fi
if [[ $FILES == "" ]]; then
DIRS=""
else
DIRS=$(dirname $FILES)
fi
sch_from_pro:
- 'SCHEMS=$(for f in $FILES ; do echo "${f%.*}.kicad_sch"; done)'
- 'SCHEMS=$(for f in $SCHEMS ; do echo "${f##**/}"; done)'
dir_arr:
- !reference [.commands, get_dirs]
- END=$(wc -w <<< $DIRS)
- dir_arr=($DIRS)
- |
FILTERED=$(echo "")
for d in $DIRS
do
if [[ "$d" =~ ^[0-9]{4}-.*$ ]]
then
FILTERED=$(echo "$FILTERED $d")
fi
done
END=$(wc -w <<< $FILTERED)
dir_arr=($FILTERED)
kibot:
- 'SEARCH=".kicad_pro"'
- !reference [.commands, dir_arr]
- !reference [.commands, sch_from_pro]
- sch_arr=($SCHEMS)
- |
cd $CI_PROJECT_DIR
for i in $(seq 1 $END)
do
if [[ ${dir_arr[i-1]} == "./Frame" ]]; then
continue
fi
echo ${dir_arr[i-1]}
echo ${sch_arr[i-1]}
python3 $CI_PROJECT_DIR/.gitlab/.scripts/orig.py ${dir_arr[i-1]}
kibot -e ${dir_arr[i-1]}/${sch_arr[i-1]} -c $CI_PROJECT_DIR/.gitlab/default.kibot.yaml -d $CI_PROJECT_DIR/Fabrication/${dir_arr[i-1]} -s $SUFFIX
mv $CI_PROJECT_DIR/Fabrication/${dir_arr[i-1]}/*.zip Fabrication/ 2> /dev/null || true
done
cd $CI_PROJECT_DIR
for i in $(seq 1 $END)
do
if [[ ${dir_arr[i-1]} == "./Frame" ]]; then
continue
fi
echo ${dir_arr[i-1]}
echo ${sch_arr[i-1]}
python3 $CI_PROJECT_DIR/.gitlab/.scripts/orig.py ${dir_arr[i-1]}
kibot -e ${dir_arr[i-1]}/${sch_arr[i-1]} -c $CI_PROJECT_DIR/.gitlab/default.kibot.yaml -d $CI_PROJECT_DIR/Fabrication/${dir_arr[i-1]} -s $SUFFIX
mv $CI_PROJECT_DIR/Fabrication/${dir_arr[i-1]}/*.zip Fabrication/ 2> /dev/null || true
done
- cd $CI_PROJECT_DIR
panel: