Re: Override Label parameter in Freestyle job

2021-04-19 Thread David Drum
The Groovy Label Assignment plugin 
<https://plugins.jenkins.io/groovy-label-assignment/> does what I want.

On Friday, April 16, 2021 at 8:50:43 PM UTC-5 David Drum wrote:

> Thanks; that is the exact plugin whose Label parameter value I am trying 
> to override and have Jenkins use the updated value to determine node 
> selection. I can update the value and have it propagate to the build, but 
> Jenkins still picks a node from the original value.
>
> On Friday, April 16, 2021 at 5:41:53 PM UTC-5 Mark Waite wrote:
>
>> You might investigate the Node and Label Parameters plugin 
>> <https://plugins.jenkins.io/nodelabelparameter/>.  I don't know that it 
>> allows Groovy script evaluation to select the label or node, but it does 
>> have many options for node and label usage with Freestyle jobs.
>>
>> On Friday, April 16, 2021 at 4:35:17 PM UTC-6 david...@sciplay.com wrote:
>>
>>> Hello, I am at wit's end trying to make Jenkins run a freestyle job 
>>> build on a node based on a Label parameter I set using a Groovy script in 
>>> the job, rather than the value provided by the user who started the build.
>>>
>>> I will be deeply grateful for (a link to) a working example. Below are 
>>> things I have tried which do not work.
>>>
>>> I am using the same Groovy script everywhere, so I will post it first 
>>> (noting that in some contexts, I replace build with currentBuild):
>>> def map = build.getBuildVariables()
>>> if (map.XcodeVersion ==~ /^12\..*$/) { map.Label = map.Label + ' && 
>>> xcode12' }
>>> return map
>>>
>>> I have tried the Environment Injector plugin's “Prepare an environment 
>>> for the run” *with* the Override Build Parameters checkbox checked. I 
>>> have tried “Run buildstep before SCM runs”. I have tried “Execute system 
>>> Groovy script”. In none of these cases have I checked the sandbox script 
>>> option. And, in none of the cases does Jenkins use the new Label expression 
>>> to decide where to run the build.
>>>
>>> I understand that I could trigger a downstream build, etc., but those 
>>> workarounds each have their downsides. I also would like to avoid telling 
>>> people that they have to remember to use boolean label expressions like 
>>> unity 
>>> && xcode12 when they start a build.
>>>
>>> If any developers are reading this, I feel Jenkins is peculiarly 
>>> inflexible about label/node selection. For example, it is not possible to 
>>> pass a parameter $FOO to the “Restrict where this project can be run” 
>>> field. Nor is it possible to define labels which expand to a label 
>>> expression. Depending on people to remember boolean expressions to use is 
>>> not really good UX.
>>>
>>> If I am going about this all wrong, none of my Google searches on the 
>>> topic have hinted at the right way to do it, except perhaps for Pipeline, 
>>> which would not be my first choice of a solution, given its intrusiveness. 
>>> Thank you for reading to the end and I hope someone can help me out. David
>>>
>>

-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/339d7dc0-60b1-4ef0-8bf9-1fa162b7f118n%40googlegroups.com.


Re: Override Label parameter in Freestyle job

2021-04-16 Thread David Drum
Thanks; that is the exact plugin whose Label parameter value I am trying to 
override and have Jenkins use the updated value to determine node 
selection. I can update the value and have it propagate to the build, but 
Jenkins still picks a node from the original value.

On Friday, April 16, 2021 at 5:41:53 PM UTC-5 Mark Waite wrote:

> You might investigate the Node and Label Parameters plugin 
> .  I don't know that it 
> allows Groovy script evaluation to select the label or node, but it does 
> have many options for node and label usage with Freestyle jobs.
>
> On Friday, April 16, 2021 at 4:35:17 PM UTC-6 david...@sciplay.com wrote:
>
>> Hello, I am at wit's end trying to make Jenkins run a freestyle job build 
>> on a node based on a Label parameter I set using a Groovy script in the 
>> job, rather than the value provided by the user who started the build.
>>
>> I will be deeply grateful for (a link to) a working example. Below are 
>> things I have tried which do not work.
>>
>> I am using the same Groovy script everywhere, so I will post it first 
>> (noting that in some contexts, I replace build with currentBuild):
>> def map = build.getBuildVariables()
>> if (map.XcodeVersion ==~ /^12\..*$/) { map.Label = map.Label + ' && 
>> xcode12' }
>> return map
>>
>> I have tried the Environment Injector plugin's “Prepare an environment 
>> for the run” *with* the Override Build Parameters checkbox checked. I 
>> have tried “Run buildstep before SCM runs”. I have tried “Execute system 
>> Groovy script”. In none of these cases have I checked the sandbox script 
>> option. And, in none of the cases does Jenkins use the new Label expression 
>> to decide where to run the build.
>>
>> I understand that I could trigger a downstream build, etc., but those 
>> workarounds each have their downsides. I also would like to avoid telling 
>> people that they have to remember to use boolean label expressions like 
>> unity 
>> && xcode12 when they start a build.
>>
>> If any developers are reading this, I feel Jenkins is peculiarly 
>> inflexible about label/node selection. For example, it is not possible to 
>> pass a parameter $FOO to the “Restrict where this project can be run” 
>> field. Nor is it possible to define labels which expand to a label 
>> expression. Depending on people to remember boolean expressions to use is 
>> not really good UX.
>>
>> If I am going about this all wrong, none of my Google searches on the 
>> topic have hinted at the right way to do it, except perhaps for Pipeline, 
>> which would not be my first choice of a solution, given its intrusiveness. 
>> Thank you for reading to the end and I hope someone can help me out. David
>>
>

-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/82562706-afca-4e7c-8b5f-07670a955d50n%40googlegroups.com.


Override Label parameter in Freestyle job

2021-04-16 Thread David Drum
Hello, I am at wit's end trying to make Jenkins run a freestyle job build 
on a node based on a Label parameter I set using a Groovy script in the 
job, rather than the value provided by the user who started the build.

I will be deeply grateful for (a link to) a working example. Below are 
things I have tried which do not work.

I am using the same Groovy script everywhere, so I will post it first 
(noting that in some contexts, I replace build with currentBuild):
def map = build.getBuildVariables()
if (map.XcodeVersion ==~ /^12\..*$/) { map.Label = map.Label + ' && 
xcode12' }
return map

I have tried the Environment Injector plugin's “Prepare an environment for 
the run” *with* the Override Build Parameters checkbox checked. I have 
tried “Run buildstep before SCM runs”. I have tried “Execute system Groovy 
script”. In none of these cases have I checked the sandbox script option. 
And, in none of the cases does Jenkins use the new Label expression to 
decide where to run the build.

I understand that I could trigger a downstream build, etc., but those 
workarounds each have their downsides. I also would like to avoid telling 
people that they have to remember to use boolean label expressions like unity 
&& xcode12 when they start a build.

If any developers are reading this, I feel Jenkins is peculiarly inflexible 
about label/node selection. For example, it is not possible to pass a 
parameter $FOO to the “Restrict where this project can be run” field. Nor 
is it possible to define labels which expand to a label expression. 
Depending on people to remember boolean expressions to use is not really 
good UX.

If I am going about this all wrong, none of my Google searches on the topic 
have hinted at the right way to do it, except perhaps for Pipeline, which 
would not be my first choice of a solution, given its intrusiveness. Thank 
you for reading to the end and I hope someone can help me out. David

-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/3a82a693-2f26-491b-ac88-d57bcead56c3n%40googlegroups.com.


Node Monitor View plugin

2018-11-05 Thread david . drum
Hello everyone,

I am looking for a plugin that provides a view into node (slave) activity, 
similar to how the Build Monitor plugin 
 displays an 
overview of jobs. I haven't found anything in the official Jenkins plugins 
directory, and wanted to check for the possibility of any unofficial 
plugins before deciding whether or not to write one. Thanks in advance.

Regards,

David

-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/0a67d60e-25f3-4675-8f41-80c191c7a467%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.