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:
andrewc
2023-10-19 20:57:55 +10:00
parent d1307c4e3d
commit 1e23a32622
4 changed files with 90 additions and 35 deletions

1
base-gitlab.yaml Normal file
View File

@@ -0,0 +1 @@
include ".gitlab/kibot-ci.yaml"

View File

@@ -1,8 +1,13 @@
# Example KiPlot config file # Example KiPlot config file
kibot: kibot:
version: 1 version: 1
import: import:
- file: JLCPCB - file: JLCPCB
definitions:
_KIBOT_POS_ENABLED: false
_KIBOT_BOM_ENABLED: false
preflight: preflight:
run_erc: true run_erc: true
update_xml: true update_xml: true
@@ -13,12 +18,15 @@ preflight:
- name: 'date' - name: 'date'
expand_kibot_patterns: true expand_kibot_patterns: true
text: '%D' text: '%D'
- name: 'name'
expand_kibot_patterns: true
command: 'echo $KIBOT_PCB_NAME | rev | cut -d"/" -f1 | rev | cut -d"-" -f1'
fill_zones: true fill_zones: true
ignore_unconnected: false ignore_unconnected: false
global: global:
environment: environment:
user_templates: "${CI_PROJECT_DIR}/.templates" user_templates: "${CI_PROJECT_DIR}/.gitlab"
outputs: outputs:
- name: 'print_sch' - name: 'print_sch'
@@ -28,15 +36,21 @@ outputs:
options: options:
output: Schematic.pdf output: Schematic.pdf
- name: 'print_front' - name: 'print_pcb'
comment: "Print F.Cu+Dwgs.User" comment: "Print Top and Bottom Copper+Silk"
type: pdf_pcb_print type: pcb_print
dir: . dir: .
options: options:
output_name: PCB_Top.pdf output_name: PCB.pdf
layers: pages:
- 'copper' - layers:
- layer: F.Cu
- layer: F.SilkS - layer: F.SilkS
- layer: Edge.Cuts
- layers:
- layer: B.Cu
- layer: B.SilkS
- layer: Edge.Cuts
- name: 'bom' - name: 'bom'
comment: "BOM in csv format" comment: "BOM in csv format"
@@ -45,18 +59,21 @@ outputs:
options: options:
columns: columns:
- field: Value - field: Value
name: Query name: value
- field: Quantity Per PCB - field: Quantity Per PCB
name: Qty name: qty
- Description - field: Footprint
name: footprint
- mpn - mpn
- manf - manf
- field: References - field: References
name: Schematic Reference name: refs
csv: csv:
separator: ';'
hide_pcb_info: true hide_pcb_info: true
hide_stats_info: true hide_stats_info: true
format: "CSV" format: "CSV"
exclude_filter: ""
- name: 'drill' - name: 'drill'
comment: "excellon drill files" comment: "excellon drill files"
@@ -83,6 +100,11 @@ outputs:
separate_files_for_front_and_back: false separate_files_for_front_and_back: false
only_smd: true only_smd: true
- name: 'stencil'
comment: '3D printable stencil for when you forgot to order it'
type: stencil_3d
dir: '3D Stencil'
- name: 'diff_pcb' - name: 'diff_pcb'
comment: "Diff for visual comparison" comment: "Diff for visual comparison"
type: diff type: diff
@@ -103,12 +125,12 @@ outputs:
groups: groups:
- name: pcb - name: pcb
outputs: outputs:
- _JLCPCB_fab - _JLCPCB_compress
- neo_position - neo_position
- print_front - print_pcb
- stencil
- name: sch - name: sch
outputs: outputs:
- bom - bom
- print_sch - print_sch

View File

@@ -14,9 +14,10 @@ variables:
stages: stages:
- gen_mech - gen_mech
- gen_fab - gen_fab
- release
image: image:
name: ghcr.io/inti-cmnb/kicad7_auto:1.6.2 name: ghcr.io/inti-cmnb/kicad7_auto:1.6.3
.main_rules: .main_rules:
rules: rules:
@@ -31,9 +32,9 @@ image:
.commands: .commands:
get_files: get_files:
- FILES=$(find . -name *$SEARCH) - FILES=$(find $CI_PROJECT_DIR -name *$SEARCH)
get_dirs: get_dirs:
- FILES=$(find . -name *$SEARCH) - FILES=$(find CI_PROJECT_DIR -name *$SEARCH)
- | - |
if [[ $FILES == "" ]]; then if [[ $FILES == "" ]]; then
DIRS="" DIRS=""
@@ -55,13 +56,13 @@ image:
- | - |
for i in $(seq 1 $END) for i in $(seq 1 $END)
do do
if [[ ${dir_arr[i-1]} == "./Frame" ]]; then if [[ ${dir_arr[i-1]} == "$CI_PROJECT_DIR/Frame" ]]; then
continue continue
fi fi
echo ${dir_arr[i-1]} echo ${dir_arr[i-1]}
echo ${sch_arr[i-1]} echo ${sch_arr[i-1]}
cd $CI_PROJECT_DIR/${dir_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 kibot -e ${sch_arr[i-1]} -c $CI_PROJECT_DIR/.gitlab/default.kibot.yaml -d $CI_PROJECT_DIR/Fabrication/${dir_arr[i-1]} -s $SUFFIX
done done
- cd $CI_PROJECT_DIR - cd $CI_PROJECT_DIR
@@ -80,7 +81,7 @@ image:
kikit panelize -p $JSON $PCB $CI_PROJECT_DIR/$NAME/$NAME.kicad_pcb kikit panelize -p $JSON $PCB $CI_PROJECT_DIR/$NAME/$NAME.kicad_pcb
touch $CI_PROJECT_DIR/$NAME/$NAME.kicad_sch touch $CI_PROJECT_DIR/$NAME/$NAME.kicad_sch
cp fp-lib-table $CI_PROJECT_DIR/$NAME/ cp fp-lib-table $CI_PROJECT_DIR/$NAME/
python3 $CI_PROJECT_DIR/.scripts/post_panel.py $CI_PROJECT_DIR/$NAME/$NAME.kicad_pro python3 $CI_PROJECT_DIR/.scripts/post_panel.py $CI_PROJECT_DIR/$NAME/$NAME.kicad_pro $PCB
done done
- cd $CI_PROJECT_DIR - cd $CI_PROJECT_DIR
@@ -90,29 +91,29 @@ image:
- | - |
for d in $DIRS for d in $DIRS
do do
if [[ $d == "./Frame" ]]; then if [[ $d == "$CI_PROJECT_DIR/Frame" ]]; then
continue continue
fi fi
echo $d echo $d
python3 .scripts/neo.py $d python3 .scripts/neo.py $d
done done
templates: git_tag:
- if [ $GITLAB_CI == 'true' ]; then git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/Micromelon/kicad-project.git .templates; fi - |
- cd .templates if [[ $GITLAB_CI == 'true' && $CI_COMMIT_BRANCH == "main" ]]; then
- shopt -s extglob git tag $CI_COMMIT_MESSAGE
- rm -rf !(*.kicad_wks) fi
- cd $CI_PROJECT_DIR
output_mech: output_mech:
stage: gen_mech stage: gen_mech
artifacts: artifacts:
when: always when: always
paths: paths:
- Fabrication/ - Fabrication/**/*
variables: variables:
SUFF_MECH: run_erc,run_drc step SUFF_MECH: run_erc,run_drc step
script: script:
- !reference [.commands, git_tag]
- SUFFIX=$SUFF_MECH - SUFFIX=$SUFF_MECH
- !reference [.commands, kibot] - !reference [.commands, kibot]
@@ -122,13 +123,14 @@ outputs_dev:
stage: gen_fab stage: gen_fab
artifacts: artifacts:
when: always when: always
name: "$CI_PROJECT_TITLE-$CI_COMMIT_SHORT_SHA"
paths: paths:
- Fabrication/ - Fabrication/**/*
expire_in: 1 week
variables: variables:
SUFF_SCH: run_drc print_sch SUFF_SCH: run_drc print_sch
SUFF_PCB: run_erc,update_xml print_front SUFF_PCB: run_erc,update_xml,set_text_variables print_pcb
script: script:
- !reference [.commands, templates]
- SUFFIX=$SUFF_SCH - SUFFIX=$SUFF_SCH
- !reference [.commands, kibot] - !reference [.commands, kibot]
- SUFFIX=$SUFF_PCB - SUFFIX=$SUFF_PCB
@@ -140,13 +142,43 @@ outputs_all:
- !reference [.main_rules, rules] - !reference [.main_rules, rules]
variables: variables:
SUFF_SCH: run_drc sch SUFF_SCH: run_drc sch
SUFF_PCB: run_erc,update_xml pcb SUFF_PCB: run_erc,update_xml,set_text_variables pcb
script: script:
- !reference [.commands, templates] - !reference [.commands, git_tag]
- SUFFIX=$SUFF_SCH - SUFFIX=$SUFF_SCH
- !reference [.commands, kibot] - !reference [.commands, kibot]
- !reference [.commands, panel]
- SUFFIX=$SUFF_PCB - SUFFIX=$SUFF_PCB
- !reference [.commands, panel]
- !reference [.commands, kibot] - !reference [.commands, kibot]
- !reference [.commands, neo] - !reference [.commands, neo]
release_job:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
needs:
- job: outputs_all
artifacts: true
rules:
- if: $CI_COMMIT_TAG
when: never # Do not run this job when a tag is created manually
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Run this job when commits are pushed or merged to the default branch
script:
- echo "running release_job for $TAG"
artifacts:
when: always
name: "$CI_PROJECT_TITLE-$CI_COMMIT_MESSAGE"
paths:
- Fabrication/**/*
expire_in: never
release: # See https://docs.gitlab.com/ee/ci/yaml/#release for available properties
tag_name: '$CI_COMMIT_MESSAGE' # The version is incremented per pipeline.
description: '$CI_COMMIT_MESSAGE'
ref: '$CI_COMMIT_SHA' # The tag is created from the pipeline SHA.
assets:
links:
- name: All Fab
url: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/download"
links:
- name: All Fab
url: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/download"