How to pass in a param into Multi branch pipeline

68 views
Skip to first unread message

Dan Tran

unread,
Mar 15, 2017, 8:23:04 PM3/15/17
to Jenkins Users
Hi 

My Jenkinsfile  has a boolean parameter, and I would like to enable a parameter via 

  - user selection
  - ENV set at the job where my groovy will detect and flip the param

However, I can't find any hook into those 2 options at top folder level

Thoughts?

-D

to be more concrete,  this particular job that I have must perform sonar:sonar, and my jenkinsfile disable this option by default

I am using declarative pipeline syntax

Dan Tran

unread,
Mar 16, 2017, 9:37:46 PM3/16/17
to Jenkins Users
anyone?  or this is a limitation of multibranch pipeline?

Thanks

-Dan

Stephen Connolly

unread,
Mar 17, 2017, 5:51:39 AM3/17/17
to jenkins...@googlegroups.com
Could you describe your use-case more concretely?

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/e3a897e6-cc62-4a55-923f-4efe8d9e6617%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Sent from my phone

Dan Tran

unread,
Mar 18, 2017, 3:22:12 AM3/18/17
to Jenkins Users
I have a requirement to run maven sonar:sonar against all branches. This means my Jenkinsfile must explicitly invoke sonar and can only run sonar only environment

if jenkins pipline allows injection of a user env variable, my Jenkinsfile can react appropriately.

However, I just found  a promising option at https://github.com/jenkinsci/workflow-multibranch-plugin/pull/59

Thanks

-Dan 

Stephen Connolly

unread,
Mar 18, 2017, 4:15:34 AM3/18/17
to jenkins...@googlegroups.com
You could also define env vars at the folder level (as multibranch is a folder) and then use conditions based on the env vars... less elegant I know


For more options, visit https://groups.google.com/d/optout.

Dan Tran

unread,
Mar 18, 2017, 1:01:58 PM3/18/17
to Jenkins Users
Unfortunately, there is no Jenkins capability to inject environment vars at folder level

Thanks

-Dan

Stephen Connolly

unread,
Mar 18, 2017, 1:15:56 PM3/18/17
to jenkins...@googlegroups.com

Dan Tran

unread,
Mar 18, 2017, 1:21:56 PM3/18/17
to jenkins...@googlegroups.com
hmm, looking further,  I need   'Folder Plus' plugin. It is not free


Thanks

-Dan


Are you sure?

To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
--
Sent from my phone

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/Taa7iD3ceB4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CA%2BnPnMy-cwhsEaqkd4%3DKvGPG3X4Mjx4LYhX5ccT3Lw-LrYbQsg%40mail.gmail.com.

Stephen Connolly

unread,
Mar 18, 2017, 1:46:20 PM3/18/17
to jenkins...@googlegroups.com
Dang! I thought that stuff was free. Oh well sorry... could have sworn...

Are you sure?

--
Sent from my phone

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/Taa7iD3ceB4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages