jp.ikedam.jenkins.plugins.groovy_label_assignment
Class GroovyLabelAssignmentProperty

java.lang.Object
  extended by hudson.model.JobProperty<hudson.model.AbstractProject<?,?>>
      extended by jp.ikedam.jenkins.plugins.groovy_label_assignment.GroovyLabelAssignmentProperty
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Describable<hudson.model.JobProperty<?>>, hudson.model.ReconfigurableDescribable<hudson.model.JobProperty<?>>, hudson.tasks.BuildStep

public class GroovyLabelAssignmentProperty
extends hudson.model.JobProperty<hudson.model.AbstractProject<?,?>>

JobProperty that holds configuration for GroovyLabelAssignment.


Nested Class Summary
static class GroovyLabelAssignmentProperty.DescriptorImpl
          Class used for working with view.
 
Nested classes/interfaces inherited from interface hudson.tasks.BuildStep
hudson.tasks.BuildStep.PublisherList
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
static String PROPERTYNAME
          Property name used for job configuration page.
 
Fields inherited from class hudson.model.JobProperty
owner
 
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
 
Constructor Summary
GroovyLabelAssignmentProperty(String groovyScript)
          Constructor from the form input.
 
Method Summary
 boolean assignLabel(hudson.model.AbstractProject<?,?> project, List<hudson.model.Action> actions)
          Decide label of nodes where the job will run.
protected  groovy.lang.Binding createBinding(hudson.model.AbstractProject<?,?> project, List<hudson.model.Action> actions)
          Create variables used in a groovy script.
 String getGroovyScript()
           
 void setGroovyScript(String groovyScript)
          Set the Groovy script.
 
Methods inherited from class hudson.model.JobProperty
getDescriptor, getJobAction, getJobActions, getJobOverrides, getProjectAction, getProjectActions, getRequiredMonitorService, getSubTasks, perform, prebuild, reconfigure, setOwner
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTYNAME

public static final String PROPERTYNAME
Property name used for job configuration page.

See Also:
Constant Field Values
Constructor Detail

GroovyLabelAssignmentProperty

@DataBoundConstructor
public GroovyLabelAssignmentProperty(String groovyScript)
Constructor from the form input.

Parameters:
groovyScript -
Method Detail

getGroovyScript

public String getGroovyScript()
Returns:
the Groovy Script

setGroovyScript

public void setGroovyScript(String groovyScript)
Set the Groovy script. For testing purpose.

Parameters:
groovyScript - the Groovy script to set

assignLabel

public boolean assignLabel(hudson.model.AbstractProject<?,?> project,
                           List<hudson.model.Action> actions)
Decide label of nodes where the job will run.

Parameters:
project - The job. This may not be the owner job if it is MatrixConfiguration.
actions - actions of job. and add LabelAssignmentAction.
Returns:
returns properly evaluate script and add label.

createBinding

protected groovy.lang.Binding createBinding(hudson.model.AbstractProject<?,?> project,
                                            List<hudson.model.Action> actions)
Create variables used in a groovy script.

Parameters:
project -
actions -
Returns:


Copyright © 2004-2015. All Rights Reserved.