Renamed .gitmodules to gitmodules, and .gitlab-ci.yml to kibot-ci.yml
Updated default.kibot.yaml and kibot-ci.yml to match DS. Added ci yaml to be copied to the root of the kicad proj, it just includes kibot-ci.yml
This commit is contained in:
152
.gitlab-ci.yml
152
.gitlab-ci.yml
@@ -1,152 +0,0 @@
|
||||
workflow:
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
|
||||
when: never
|
||||
- if: $CI_COMMIT_BRANCH
|
||||
|
||||
variables:
|
||||
GIT_STRATEGY: clone
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
GIT_SUBMODULE_DEPTH: 1
|
||||
GIT_SUBMODULE_FORCE_HTTPS: "true"
|
||||
|
||||
stages:
|
||||
- gen_mech
|
||||
- gen_fab
|
||||
|
||||
image:
|
||||
name: ghcr.io/inti-cmnb/kicad7_auto:1.6.2
|
||||
|
||||
.main_rules:
|
||||
rules:
|
||||
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"'
|
||||
- if: $CI_COMMIT_BRANCH == "main"
|
||||
- if: $GITLAB_CI == 'false'
|
||||
|
||||
.dev_rules:
|
||||
rules:
|
||||
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "dev"'
|
||||
- if: $CI_COMMIT_BRANCH == "dev"
|
||||
|
||||
.commands:
|
||||
get_files:
|
||||
- FILES=$(find . -name *$SEARCH)
|
||||
get_dirs:
|
||||
- FILES=$(find . -name *$SEARCH)
|
||||
- |
|
||||
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)
|
||||
kibot:
|
||||
- 'SEARCH=".kicad_pro"'
|
||||
- !reference [.commands, dir_arr]
|
||||
- !reference [.commands, sch_from_pro]
|
||||
- sch_arr=($SCHEMS)
|
||||
- |
|
||||
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]}
|
||||
cd $CI_PROJECT_DIR/${dir_arr[i-1]}
|
||||
kibot -e ${sch_arr[i-1]} -c $CI_PROJECT_DIR/default.kibot.yaml -d $CI_PROJECT_DIR/Fabrication/${dir_arr[i-1]} -s $SUFFIX
|
||||
done
|
||||
- cd $CI_PROJECT_DIR
|
||||
|
||||
panel:
|
||||
- 'SEARCH="_panel.json"'
|
||||
- !reference [.commands, get_dirs]
|
||||
- |
|
||||
for d in $DIRS
|
||||
do
|
||||
echo $d
|
||||
cd $CI_PROJECT_DIR/$d
|
||||
JSON=$(find *_panel.json)
|
||||
NAME=$(echo "${JSON%.json}")
|
||||
PCB=$(find *.kicad_pcb)
|
||||
mkdir $CI_PROJECT_DIR/$NAME
|
||||
kikit panelize -p $JSON $PCB $CI_PROJECT_DIR/$NAME/$NAME.kicad_pcb
|
||||
touch $CI_PROJECT_DIR/$NAME/$NAME.kicad_sch
|
||||
cp fp-lib-table $CI_PROJECT_DIR/$NAME/
|
||||
python3 $CI_PROJECT_DIR/.scripts/post_panel.py $CI_PROJECT_DIR/$NAME/$NAME.kicad_pro
|
||||
done
|
||||
- cd $CI_PROJECT_DIR
|
||||
|
||||
neo:
|
||||
- 'SEARCH=".kicad_pro"'
|
||||
- !reference [.commands, get_dirs]
|
||||
- |
|
||||
for d in $DIRS
|
||||
do
|
||||
if [[ $d == "./Frame" ]]; then
|
||||
continue
|
||||
fi
|
||||
echo $d
|
||||
python3 .scripts/neo.py $d
|
||||
done
|
||||
|
||||
templates:
|
||||
- if [ $GITLAB_CI == 'true' ]; then git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/Micromelon/kicad-project.git .templates; fi
|
||||
- cd .templates
|
||||
- shopt -s extglob
|
||||
- rm -rf !(*.kicad_wks)
|
||||
- cd $CI_PROJECT_DIR
|
||||
|
||||
output_mech:
|
||||
stage: gen_mech
|
||||
artifacts:
|
||||
when: always
|
||||
paths:
|
||||
- Fabrication/
|
||||
variables:
|
||||
SUFF_MECH: run_erc,run_drc step
|
||||
script:
|
||||
- SUFFIX=$SUFF_MECH
|
||||
- !reference [.commands, kibot]
|
||||
|
||||
outputs_dev:
|
||||
rules:
|
||||
- !reference [.dev_rules, rules]
|
||||
stage: gen_fab
|
||||
artifacts:
|
||||
when: always
|
||||
paths:
|
||||
- Fabrication/
|
||||
variables:
|
||||
SUFF_SCH: run_drc print_sch
|
||||
SUFF_PCB: run_erc,update_xml print_front
|
||||
script:
|
||||
- !reference [.commands, templates]
|
||||
- SUFFIX=$SUFF_SCH
|
||||
- !reference [.commands, kibot]
|
||||
- SUFFIX=$SUFF_PCB
|
||||
- !reference [.commands, kibot]
|
||||
|
||||
outputs_all:
|
||||
extends: outputs_dev
|
||||
rules:
|
||||
- !reference [.main_rules, rules]
|
||||
variables:
|
||||
SUFF_SCH: run_drc sch
|
||||
SUFF_PCB: run_erc,update_xml pcb
|
||||
script:
|
||||
- !reference [.commands, templates]
|
||||
- SUFFIX=$SUFF_SCH
|
||||
- !reference [.commands, kibot]
|
||||
- !reference [.commands, panel]
|
||||
- SUFFIX=$SUFF_PCB
|
||||
- !reference [.commands, kibot]
|
||||
- !reference [.commands, neo]
|
||||
|
||||
Reference in New Issue
Block a user