[JIRA] (JENKINS-60446) Add option to pass custom paramters from multibranch to the trigger jobs

25 views
Skip to first unread message

oleksii.baranov.dev@gmail.com (JIRA)

unread,
Dec 11, 2019, 11:05:02 AM12/11/19
to jenkinsc...@googlegroups.com
Oleksii Baranov created an issue
 
Jenkins / New Feature JENKINS-60446
Add option to pass custom paramters from multibranch to the trigger jobs
Issue Type: New Feature New Feature
Assignee: Aytunc BEKEN
Components: multibranch-action-triggers-plugin
Created: 2019-12-11 16:04
Environment: multibranch-action-triggers-plugin v1.5
Priority: Minor Minor
Reporter: Oleksii Baranov

It would be nice to have additional option in the multichannel pipline configuration to specify custom parameters to pass to the tirgger job.

The problem we are facing right now is next. We have a lot of multibranch projects for different apps: 

 

 

app1

    master branch

    feature1

app2

    master

app3

   ....
 

 

But for most of those apps the OnDelete trigger job performs the same steps. The only difference is that we need to cleanup resources according to the app name. We want to have only one OnDelete job for all those multibranch projects but provide parameters together with SOURCE_PROJECT_NAME param to indicate for what app we've triggered job.

Also it might be useful to pass other custom parameters from the upstream job.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

aytuncbeken.ab@gmail.com (JIRA)

unread,
Dec 11, 2019, 11:38:03 AM12/11/19
to jenkinsc...@googlegroups.com
Aytunc BEKEN commented on New Feature JENKINS-60446
 
Re: Add option to pass custom paramters from multibranch to the trigger jobs

Hi,

I understand the situation you are having. It make sense when you have lots of jobs/branches. For a quick solution I can add another parameter with the Full name of the branch job ( Ex: app1/master) which calls the onDelete Trigger Job. Is this okay ?

For adding custom parameters from the upstream job, I need to understand requirements well, can you give more detailed example ?

Thanks for the suggestions!

oleksii.baranov.dev@gmail.com (JIRA)

unread,
Dec 12, 2019, 5:07:05 AM12/12/19
to jenkinsc...@googlegroups.com

Hi Aytunc,

Adding another parameters with the upstream multibranch job full name and branch (app1/master) sounds like a good idea and will unblock us.

Regarding custom parameters. I think here what we need:

 - plugin should provide UI to define a list of parameters which will be passed to the trigger job as the job parameters. For example, in our case, we need to pass the KUBERNETES_NAMESPACE_NAME to the trigger job to understand what namespace to cleanup once branch is removed. I imagine that we may want to pass something else, like, ENVIRONMENT (preprod, preview, prod).
 - I don't think we need to try and create those parameters in the trigger job.

 

 

aytuncbeken.ab@gmail.com (JIRA)

unread,
Dec 17, 2019, 4:52:02 AM12/17/19
to jenkinsc...@googlegroups.com
Aytunc BEKEN started work on New Feature JENKINS-60446
 
Change By: Aytunc BEKEN
Status: Open In Progress

aytuncbeken.ab@gmail.com (JIRA)

unread,
Dec 17, 2019, 9:13:03 AM12/17/19
to jenkinsc...@googlegroups.com

Hi,

Full name parameters is released with the 1.6 version, probably It will be downloadable soon.
For the other parameters thing, I need to work on it.

jenkins.io@oguzhanuysal.eu (JIRA)

unread,
Feb 4, 2020, 4:46:02 AM2/4/20
to jenkinsc...@googlegroups.com

Hi,

 

We're having a similar where we use a multibranch project with parameterized builds. Is it not possible to pass the parameters through so the jobs that we trigger have access to upstream parameters.

aytuncbeken.ab@gmail.com (JIRA)

unread,
Feb 6, 2020, 9:34:03 AM2/6/20
to jenkinsc...@googlegroups.com

Hi, I started working on it. Probably release in one week.

aytuncbeken.ab@gmail.com (JIRA)

unread,
Feb 7, 2020, 7:43:03 AM2/7/20
to jenkinsc...@googlegroups.com

Hi,

Adding custom parameters feature is released with 1.8 version. Probably It will be available soon in the plugin site.
Please let me know, then I will close the ticket.

Thanks.

aytuncbeken.ab@gmail.com (JIRA)

unread,
Feb 7, 2020, 7:43:04 AM2/7/20
to jenkinsc...@googlegroups.com

jenkins.io@oguzhanuysal.eu (JIRA)

unread,
Feb 10, 2020, 2:58:04 AM2/10/20
to jenkinsc...@googlegroups.com
Oguzhan Uysal commented on New Feature JENKINS-60446
 
Re: Add option to pass custom paramters from multibranch to the trigger jobs

Hi Aytunc BEKEN,

Works like a charm, and having support for environment variables as values makes it even better. Thanks for picking this up quickly.

jenkins.io@oguzhanuysal.eu (JIRA)

unread,
Feb 10, 2020, 3:09:03 AM2/10/20
to jenkinsc...@googlegroups.com
Oguzhan Uysal edited a comment on New Feature JENKINS-60446
Hi [~aytuncbeken],

- Works like a charm, and having support for environment variables as values makes it even better. Thanks for picking this up quickly. -

I spoke too soon sorry. 

In our multibranch project we define parameters and environment variables in the jenkinsfile to determine if a deployment should take place and to which environment. These values are dynamic and assigned to the env in the build context. Is it possible to pass these dynamic values to the job triggered by this plugin?

setting `${ENV}` passes the literal string instead of the expected value

aytuncbeken.ab@gmail.com (JIRA)

unread,
Feb 10, 2020, 3:39:02 AM2/10/20
to jenkinsc...@googlegroups.com

Hi,

To be in the same page, I will write what I understood.
You have your parameters/variables in your Jenkins file.g
So you are asking if it is possible to pass these parameters/variables to the jobs which are triggered by this plugin.
If this is the case, I need search if it is possible or not. Because triggering occurs in the Jenkins branch indexing action which is before checking the Jenkinsfile.

As this is different from the current enhancement. I will be glad if you can open a new ticket so I can close this.

Thanks.

jenkins.io@oguzhanuysal.eu (JIRA)

unread,
Feb 10, 2020, 3:50:02 AM2/10/20
to jenkinsc...@googlegroups.com

Hi,

Your interpretation of my issue/request is correct. As requested i have opened a new issue, https://issues.jenkins-ci.org/browse/JENKINS-61027.
Thank you for your help. 

aytuncbeken.ab@gmail.com (JIRA)

unread,
Feb 10, 2020, 3:58:03 AM2/10/20
to jenkinsc...@googlegroups.com

Thanks a lot.

Oleksii Baranov I will close this issue as I assume it is working as requested.

aytuncbeken.ab@gmail.com (JIRA)

unread,
Feb 10, 2020, 4:00:05 AM2/10/20
to jenkinsc...@googlegroups.com
Change By: Aytunc BEKEN
Status: In Review Resolved
Resolution: Fixed
Released As: 1.8
Reply all
Reply to author
Forward
0 new messages