#Centralized set of Tools for CI/CD pipelines

1 messages · Page 1 of 1 (latest)

sage gyro
#

Hi all. I'm absolutely thrilled to try Dagger as main CI/CD tool. I have a question (a stupid one for sure):
We have a lot of microservices developed in different languages. Services with the same technologies (eg python) are developed using a sort of standard (poetry as package manager, fastapi, ...) and the Dockerfiles are mainly copied and pasted for this reason. I was looking at a way to effectively centralize the code to be used by different repository.

I was thinking at a repository containing the definition of all Dockerfiles and Pipelines (in dagger way) which can be used by other repositories. Which is the best way to achieve that?
Do you think that i should create a simple go package with utils and in each repo create the ci package with dagger init ... which are using this custom package, or you think that is better to write all dagger functions in the repo and call them in (eg) github actions using dagger command (dagger -m github.com/shykes/daggerverse/hello@v0.1.2 call hello)?

dry plume
#

Welcome!

There are no stupid questions, this one in particular is a really good one 🙂

For shared modules we see two main patterns, one monorepo with a bunch of modules, or one module per repo. There is no right or wrong way and Dagger supports both.

When it comes to your project though, you may also have a dagger module that defines some project specific functionality that takes advantage of the module library that you are developing.

You could also have a separate repo that contains all of your CI config that takes your project repo as a parameter. The main benefit of this would be to keep your main project commit history as clean as possible.

My advice is to start simple and refactor from there. It's easy to fall into a bit of a rabbit hole with premature optimization 🙂

sage gyro
#

thank you for the response and for the amazing advices 🙏

#

Is there any repo where find some examples for this use case?

jolly ravine