Readonly job parameters

1,674 views
Skip to first unread message

Thomas Fields

unread,
Jul 21, 2013, 1:17:27 AM7/21/13
to jenkins...@googlegroups.com
Hi there,

In my job configs I've been ticking the "This build is parameterized" box and then using the String parameter option. I can then use my new parameter through most of my job setup and so far this has been working great.

I'm now in a situation where I want my String parameter to be uneditable. So when the user clicks the Build Now link, I want to display what the parameter is set to but not let the user change it. Is it possible to do this?

Cheers,
Tom

Pete

unread,
Jul 21, 2013, 9:49:24 AM7/21/13
to jenkins...@googlegroups.com
No, that I am aware of.  I've been kind of thinking about something similar but more of like a set of variables that can be defined with the job, and then referenced in multiple places within the job configuration.


--
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/groups/opt_out.
 
 

Daniel Beck

unread,
Jul 21, 2013, 10:17:16 AM7/21/13
to jenkins...@googlegroups.com
envinject plugin does this. But not visible as 'fake' job parameters.

Thomas Fields

unread,
Jul 21, 2013, 4:53:33 PM7/21/13
to jenkins...@googlegroups.com
    >>No, that I am aware of. I've been kind of thinking about something similar
    but more of like a set of variables that can be defined with the job, and
    then referenced in multiple places within the job configuration.
Yeah, something like this would be perfect for my needs. 

Surely it's not too difficult to add a new "read only string parameter" to the parameter options in the job description then display it but obviously don't let the user edit it. Did you enter this in Jira already?

Cheers
Tom

"N. Hao Ching 程浩源"

unread,
Jul 21, 2013, 6:05:06 PM7/21/13
to jenkins...@googlegroups.com, jenkins...@googlegroups.com
--

Daniel Beck

unread,
Jul 22, 2013, 5:42:20 AM7/22/13
to jenkins...@googlegroups.com
An actual use case for this might be helpful. Right now, this looks a lot like an XY problem [1].

Also, a possible solution is a Choice parameter with only one value to select. But note that e.g. Parameterized Trigger will just override this when you specify a different value there, so it's on the UI only.

1: http://www.perlmonks.org/?node_id=542341

Benjamin Hofmann

unread,
Jul 29, 2013, 3:35:17 AM7/29/13
to jenkins...@googlegroups.com, m...@beckweb.net
My personal usecase would be to differ between an auto triggered build and a manual build. But I believe the envinject can fulfill that need quite well.

Vincent Latombe

unread,
Jul 29, 2013, 4:20:44 AM7/29/13
to Jenkins Users
Hi,

The environment variable BUILD_CAUSE already provides you how the build has been triggered. You don't need any plugin or parameter to get this information.

Cheers,

Vincent


2013/7/29 Benjamin Hofmann <benjamin...@jumio.com>

Ilamparithi

unread,
Dec 4, 2013, 3:00:58 AM12/4/13
to jenkins...@googlegroups.com


Hi,

You probably might have found a solution now. Anyway I had similar requirement recently and found this thread. Later I came across a plugin https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+Dynamic+Parameter+Plug-in. Using this plugin you can send a dynamic parameter to the build. It also has an option to make that parameter read-only. Have fun!

Ilamparithi
Reply all
Reply to author
Forward
0 new messages