How to build a work pipeline in Jenkins?

In my project, I have 3 web applications, all depend on one all-commons project.

I built 4 jobs on my Jenkins server, all-commons_RELEASE , web-A_RELEASE , web-B_RELEASE and web-C_RELEASE . The role of these jobs is to create artifacts that are deployed on our Nexus. Then someone retrieves these artifacts on Nexus and deploys them on our dev / homologation servers.

What I want is to have one (optional?) Task that will run all 4 assemblies in sequential order. Thus, as soon as this task is completed, all RELEASE tasks will be completed. Of course, if one assembly fails, the process stops.

My first thought was to list web-A_RELEASE in the Build list of other Post-build all-commons_RELEASE action projects. Then web-B_RELEASE depends on web-A_RELEASE , etc.

However, I want to be able to run any of them separately, which is not possible if I indicate the dependence on projects. For example, if I manually started web-B_RELEASE , then web-B_RELEASE will be built, which is not what I want ...

Do you have an idea how I can achieve this, or a plugin that will help me do this?

Sincerely.

ps: Jenkins 1.430, and all the RELEASE jobs are free-style projects (they mix the Maven and bash commands).

+4
source share
3 answers

Perhaps you could use the Parametrized Trigger Plugin ?

Using the plugin, you can set the trigger as a build step in your Pipeline task. There is a checkbox "Block until the completion of a given task", which must be activated. You could just set up three tasks to run this way, and the launch will only happen if you run this new task on the pipeline, so starting other tasks without starting any actions will work fine.

This should be exactly what you need.

+3
source

I don’t know if you found your answer, but for others who are curious:

You can create another build_all task and then run each of the other assemblies as build steps.

The setup you need will look like this: build_all , and each build step will be performed "Create a trigger / call for other projects"

  • Step 1: all-commons_RELEASE
  • Step 2: Web A_RELEASE
  • Step 3: Web B_RELEASE
  • Step 4: Web C_RELEASE

Make sure you select the "Block until running projects complete their assemblies" check box to ensure that assemblies occur sequentially.

+2
source

try it

Thread assembly plugin

You can sequentially start or build your work as follows:

 build("job1") build("job2") . . build("job-n") 
+1
source

All Articles