Skip to content

[HOW] Best practice setup CI/CD for Kibot #575

@Nudelsalad

Description

@Nudelsalad

I am figuring out the best approach to have a pipeline running for all my kicad projects stored inside Gitlab.

I am currently seeing therefore three approaches:

Most general one:

  • Inside every project there is the same simple Gitlab-ci.yml file pointing to a generous Gitlab-ci.yml inside the config repository. There the general CI/CD Workflow is defined and the kibot jobs get executed at a certain event(push/merge/tag) with the same config.

Current Problem:

  • specifying a different fabricator yaml can be done via an environment variable which gets passed to the yaml in the CI -> not very handy
  • no fix amount of parameters, varies from project to project so yaml substitution or preprocessing by overwriting a different amount and different parameters seems impossible

Advantages:

  • no hardware guy needs to touch a kibot.yaml

Disadvantages:

  • no further yaml substitution and preprocessing possible without having to much Gitlab-ci variables involved

For me it is very important to have always a fine grained control on what is being outputted, if nothing is specified or no kibot.yaml is found inside the project it takes a generous one. Therefore I figured out the following 2 approaches(first might be impossible?):

First idea

  1. Defining the output jobs for every manufacturer with the same output ==names==
  2. Putting a kibot.yaml file into every repository which gets executed by pipeline if exists
  3. importing the default config and the needed config (e.g.:JLCPCB) after that (to let overwrite the default output configs of existing outputs with those of JLCPCB)
  4. executing kibot in CI to execute the output jobs

Advantages:

  • if no fine grained control wished, no hardware guy needs to touch a kibot.yaml
  • fine grained control possible

Disadvantages:

  • having the same name for outputs here is important to not make any changes to CI necessary
  • only works if existing outputs gets overwritten if an output with the same name occurs

So my question now:

Does kibot only concatenate the yaml files or does he also substitute already defined outputs where the output name is the same with the imported ones?

Second idea (workaround to this problem)

An option would be to define only certain jobs in one file and to import the rest where the fabrication outputs all have the same name.

Generous file in every repo (or if nothing is found, take always a generous one with imported default.kibot.yml fabrication outputs):

Needs to be specified inside every fine grained controlled repository:

main.kibot.yaml

BOM, IBOM, 3D model, kiri
Import config here # needs to be set by hand
# YAML substitution or preprocessing now possible

fabrication output jobs where the output names are the same so the CI can call them seamlessly all with the same name

default.kibot.yaml
gerber, drill, pick and place

jlpcb.kibot.yaml
gerber, drill, pick and place

Your internal templates for outputs provide all different names for outputs, this is why I ask this question. Also maybe as a kind of guideline to setup CI/CD workflow for me and others.

Interesting to know would also be if I import an anchor of the same name if this does overwrite the settings

I have already running the first mentioned approach. Kind of unhappy that no fine grained control is possible there. Seeing forward to your expertise @set-soft and contributing this to the docs if wished to help future me and others.

Metadata

Metadata

Assignees

Labels

questionThis is just a question, not a problem

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions