0

I have 4 microservices and all of them are built on the same technology stack (Java Dropwizard, MySQL), and I'm trying to create a CI/CD pipeline for them, but the question here is:

Is it a good idea to have a separate Jenkins job for each microservice? Or it it better to have only one job that is parameterized for all of the microservices?

What I need to run in my CI/CD is:

  1. clean build
  2. unit test
  3. integration test
  4. load test
  5. build docker containers and images
  6. release
  7. push artifacts
  8. deploy
M1M6
  • 915
  • 3
  • 17
  • 33

2 Answers2

0

Creating a job for each project and using MultiJob plugin to add these jobs to build pipeline is a good way. Then you can trigger the parent job to start the pipeline.

miskender
  • 7,460
  • 1
  • 19
  • 23
0

I would use Declarative Pipelines where you can define your logic in a local Jenkinsfile in your repositories.

Using Jenkins, you can have a "master" Jenkinsfile and/or project that you can inherit by invoking the upstream project. This will allow you to effectively share your instructions and reduce duplication.

At the end of the day you will have to either create a separate project for each repository/purpose due to how Jenkins works OR (recommended) have a "master" project that let's you pass in things like project name, git repo url, specific application variables and values and so on.

yomateo
  • 2,078
  • 12
  • 17