Jenkins Conditional Project

The projects related to my related solution are the initialization database, the import database, and the export database. If initialization succeeds, call "export". If it fails, an import should be called.

dbinit / \ export import 

Logically, it is quite simple; however, due to my lack of Jenkins experience, this causes significant sorrow.

I looked at the following plugins:

Conditional BuildStep - This basically adds the 'if' statement to the assembly. I researched this with the idea that export / import projects can be combined into one project, using the condition to decide which course of action to take. This could work if I could check the status of the upstream assembly (success or failure)

The task of creating an assembly is to execute a shell script based on the output of the log. This will go in the dbinit project. The problem is that I would like the import / export jobs to be separate from dbinit. This will work if I can call another job from the shell

Parameterized Trigger - It may be perfect. This will basically solve the problem by deciding what work to do based on the status of this assembly. However, at the time of writing this plugin, this code does not work correctly with Jenkins version 1.481 or higher. This problem was raised a month ago (see the error link dated September 12, 2012) and has not yet been fixed, so I'm still looking for another solution.

Can someone tell me how to overcome the identified issues with any of these plugins? Or is there another route I missed?

Thank you very much,

Rory

+4
source share
2 answers

In case jenkins 1.481 or later does not give you anything you need and Parametrized Trigger works, just use 1.480 and wait until the problem is fixed (it will probably get a fixed, such a popular plugin).

+1
source

Did Build Result Trigger help you ?

With BuildResultPlugin, you configure jobB to monitor the result of the jobA assembly. Assembly is planned if a new assembly result meets your criteria (unstable, failure, ...)

0
source

Source: https://habr.com/ru/post/1438414/


All Articles