Neo: fixed up script to point to the 'Fabrication' folder properly

Variants: able to use kibot variants, separate variants for: mech, sch,
and pcb outputs. This because a BOM variant does not affect the PCB, but it might affect the step file.
This commit is contained in:
ac
2025-04-29 21:29:05 +10:00
parent cf480237f5
commit ebee7ef48e
10 changed files with 201 additions and 99 deletions

View File

@@ -20,7 +20,7 @@ stages:
- release
image:
name: ghcr.io/inti-cmnb/kicad8_auto:1.8.2
name: ghcr.io/inti-cmnb/kicad8_auto:1.8.4
.main_rules:
rules:
@@ -82,27 +82,33 @@ image:
fi
echo ${dir_arr[i-1]}
echo ${sch_arr[i-1]}
USER_FILE="$CI_PROJECT_DIR/.gitlab/blank.kibot.yaml"
if [ -f "${dir_arr[i-1]}/kibot.yaml" ]; then
USER_FILE="${dir_arr[i-1]}/kibot.yaml"
fi
cp $USER_FILE $CI_PROJECT_DIR/kibot.yaml
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
for CONF in $KIBOT_CONF
do
kibot -e ${dir_arr[i-1]}/${sch_arr[i-1]} -c $CI_PROJECT_DIR/.gitlab/$CONF.kibot.yaml -d $CI_PROJECT_DIR/Fabrication/${dir_arr[i-1]} $VARIANTS
done
mv $CI_PROJECT_DIR/Fabrication/${dir_arr[i-1]}/*.zip Fabrication/ 2> /dev/null || true
done
- cd $CI_PROJECT_DIR
panel:
pre_panel:
- cd $CI_PROJECT_DIR
- mkdir panels
- 'SEARCH="_panel.json"'
- !reference [.commands, get_dirs]
- |
mkdir panels
cd $CI_PROJECT_DIR
for d in $DIRS
do
echo "found panel"
echo $d
echo "found panel: $d"
JSON=$(find $d/*_panel.json)
FILE=$(basename "${JSON}")
NAME=$(echo "${FILE%.json}")
PCB=$(find $d/*.kicad_pcb)
echo "mkdring"
mkdir -p panels/$NAME
echo "panelising"
kikit panelize -p $JSON $PCB panels/$NAME/$NAME.kicad_pcb
@@ -110,10 +116,10 @@ image:
cp $d/fp-lib-table panels/$NAME/
python3 .gitlab/.scripts/post_panel.py panels/$NAME/$NAME.kicad_pro $PCB
done
- cd panels || true
- !reference [.commands, kibot]
- cd panels
post_panel:
- mv panels/* . || true
- rm -rf panels/ || true
neo:
- 'SEARCH=".kicad_pro"'
@@ -231,87 +237,86 @@ image:
strip_tag:
- TAG=$(echo ${CI_COMMIT_MESSAGE} | tr -d \\n)
output_mech:
outputs_mech:
stage: gen_mech
when: always
artifacts:
when: always
paths:
- Fabrication/**/*
variables:
SUFF_MECH: erc,drc step pcb_render pcba_render
script:
- !reference [.commands, git_tag]
- SUFFIX=$SUFF_MECH
- !reference [.commands, kibot]
outputs_dev:
rules:
- !reference [.dev_rules, rules]
stage: gen_fab
artifacts:
when: always
name: "$CI_PROJECT_TITLE-$CI_COMMIT_SHORT_SHA"
paths:
- Fabrication/**/*
expire_in: 1 week
variables:
SUFF_SCH: drc sch
SUFF_PCB: erc,update_xml,set_text_variables print_pcb
script:
before_script:
- !reference [.commands, git_tag]
- SUFFIX=$SUFF_SCH
- !reference [.commands, kibot]
- SUFFIX=$SUFF_PCB
script:
- VARIANTS="$VARIANTS_MECH"
- KIBOT_CONF="mech"
- !reference [.commands, kibot]
outputs_all:
extends: outputs_dev
rules:
- !reference [.main_rules, rules]
variables:
SUFF_SCH: drc sch
SUFF_PCB: erc,update_xml,set_text_variables pcb
SUFF_PANEL: erc,update_xml,set_text_variables pcb_panel
outputs_dev:
extends: outputs_mech
stage: gen_fab
script:
- !reference [.commands, git_tag]
- SUFFIX=$SUFF_SCH
# SCH
- VARIANTS="$VARIANTS_SCH"
- KIBOT_CONF="sch"
- !reference [.commands, kibot]
- SUFFIX=$SUFF_PCB
# PCB
- VARIANTS="$VARIANTS_PCB"
- KIBOT_CONF="pcb_dev"
- !reference [.commands, kibot]
outputs_main:
extends: outputs_dev
script:
# SCH
- VARIANTS="$VARIANTS_SCH"
- KIBOT_CONF="sch"
- !reference [.commands, kibot]
# PCB
- VARIANTS="$VARIANTS_PCB"
- KIBOT_CONF="pcb_main"
- !reference [.commands, kibot]
# Panels
- !reference [.commands, pre_panel]
- KIBOT_CONF="panel"
- !reference [.commands, kibot]
- !reference [.commands, post_panel]
# Pos
- VARIANTS="$VARIANTS_SCH"
- KIBOT_CONF="pos"
- !reference [.commands, kibot]
- SUFFIX=$SUFF_PANEL
- !reference [.commands, panel]
- !reference [.commands, neo]
- ls Fabrication/
inventree_job_dev:
stage: inventree
rules:
- !reference [.dev_rules, rules]
needs:
- job: output_mech
- job: outputs_mech
artifacts: true
- job: outputs_dev
artifacts: true
rules:
- !reference [.dev_rules, rules]
script:
- !reference [.commands, boms]
inventree_job:
inventree_job_main:
stage: inventree
needs:
- job: output_mech
artifacts: true
- job: outputs_all
artifacts: true
rules:
- !reference [.main_rules, rules]
needs:
- job: outputs_mech
artifacts: true
- job: outputs_main
artifacts: true
script:
- !reference [.commands, boms]
upload_job:
stage: upload
needs:
- job: inventree_job
- job: outputs_all
- job: inventree_job_main
- job: outputs_main
artifacts: true
rules:
- if: $CI_COMMIT_TAG