Composite project Jenkins pipeline setup

Hi,

I intend to create a Jenkins pipeline for a Jmix Composite project. There are 3 components in this project: ‘all’ - that is the aggregating subproject, that combines all the other projects into a single one. There is a ‘main’ project, that runs the application itself and there is an add-on, names ‘test-addon’ that is linked to the ‘main’ project.

What is the best practice to upload this project into Jenkins? In which project should I focus on for this purpose? Should I add the jenkinsfile to the ‘all’ or the ‘main’ one or simply just add it to the root folder of these 3 projects? Is there any documentation available regarding this topic?

Thanks,
Peter

Greetings,

If i would write jenkins pipeline from scratch to build jmix composite project, i would create several tasks:

  1. Gradle Root - Test (tests for all sub projects)
  2. Gradle - Jar for all sub projects and move it into single bundle (lib project will be put into runtime project automatically) OR
    2.1) Boot Build Image (for docker) for each “runtime” projects, before build “common library project”
  3. Deploy all “runtime” images into environment that you are using

In nutshell, this is simple build can be explaned:
You have several “runtime” projects that need to run in environment
And those projects are depends on “common library”, by gradle it should be automatically build and put into “runtime” JARs when you are building any of your “runtime” applications.

No, there is no documentation about Jenkins, but Jmix for deploy is a simple Spring Boot application, so your can find any topics about “how to deploy Spring Boot with Jenkins pipelines” and you will solve your problem.

If you still haven’t solved the problem, ask questions and reply this topic.

Regards,
Dmitry

Hi Dmitry,

Thanks for your answer. Yeah, when we deploy a simple Jmix project through Jenkins everything is working fine. It is working as a simple SB project as you said.

However, when we want to deploy a composite project, the process is not that simple. In our case we want to create a proper configuration for deployment which ideally has all the necessary gradle, jenkins and docker files in the root folder. So far we could manage most of these, so we have everything in the root folder and can deploy the project into Jenkins, but there still is a weak point. During the process the generated jar file is not runnable. We use ‘gradle clean build --refresh-dependencies’ for this purpose. There is no error, but it is basically empty. Project depencies are added to it based on the SB example you sent. Actually we are not sure if this was the best option we could choose, that is why I asked about the best practice for creating a pipeline and configuring the gradle project.

Could you please provide a gradle config for a jmix composite project that generates a runnable jar file (ideally in the project root folder (/build/libs)) at build? I found a Jmix composite project example on github: GitHub - jmix-projects/sample-composite-project. It would be perfect if you could give us a working example using this project.

Thanks,
Peter