[Trigger Pipeline] Why is TriggerConfiguration index Idx_NameUnique unique?

Forge Component
(2)
Published on 21 Jun by Rui Mendes
2 votes
Published on 21 Jun by Rui Mendes

Hi,

I was wondering why this unique index exsists.

Would it not be nice if I could defined multiple triggers (with different application clusters) that use the same pipeline in Jenkins?

We use Jenkins in a large factory, with different clusters of applications. Now we have to duplicate the pipeline logic in Jenkins to be able to define multiple triggers.

In a previous discussion a backlog was mentioned, would it be possible to share a roadmap (no strings attached) to gives us a peek to what we could possible expect in the near future for this great CI/CD integration?

Regards,

Daniel

Solution

Hi Daniël,

The purpose of the unique index is to avoid creating multiple triggers for the same pipeline. 

According to our CI/CD practice, each application cluster that qualifies as an independent deployable unit should have a dedicated CI/CD pipeline. Among other benefits, this approach allows collecting meaningful metrics over time for each pipeline (lead time, failed test cases, etc.) which are not easily obtainable when using a single pipeline to promote multiple application clusters.      

As a best practice, if you have multiple pipelines that share the same pipeline definition (i.e. the Jenkinsfile) you can store this file in a git repository and create your pipelines using the 'Pipeline script from SCM' option (instead of supplying the Jenkinsfile inline for each newly created pipeline).

Nevertheless, we can consider removing the unique index constraint in an upcoming plugin version to cater for a broader usage of the Trigger Pipeline plugin like the scenario you described.

Regarding your question about roadmap definition, we don't have that information currently available but we're planning to move everything related with our CI/CD pipeline implementation (including documentation) to our GitHub repository.

Cheers,

Rui Mendes

Solution

Hi Rui,

Thanks for the clear response. I think this is the answer I was looking for:

"As a best practice, if you have multiple pipelines that share the same pipeline definition (i.e. the Jenkinsfile) you can store this file in a git repository and create your pipelines using the 'Pipeline script from SCM' option (instead of supplying the Jenkinsfile inline for each newly created pipeline)."

Regards,

Daniel