Groovy Documentation

javaposse.jobdsl.dsl.helpers
[Groovy] Class TopLevelHelper

java.lang.Object
  javaposse.jobdsl.dsl.helpers.AbstractHelper
      javaposse.jobdsl.dsl.helpers.TopLevelHelper

class TopLevelHelper
extends AbstractHelper

Nested Class Summary
static class TopLevelHelper.EnvironmentVariableContext

static class TopLevelHelper.Port

static class TopLevelHelper.PortsContext

static enum TopLevelHelper.Timeout

Enumeration of timeout types for parsing and error reporting

static class TopLevelHelper.TimeoutContext

Context to configure timeout

 
Property Summary
JobManagement jobManagement

boolean labelAlreadyAdded

"Restrict where this project can be run" FullTools&&RPM&&DC

 
Constructor Summary
TopLevelHelper(java.util.List withXmlActions, JobType jobType, JobManagement jobManagement)

 
Method Summary
java.lang.Object allocatePorts(java.lang.String[] portsArg, groovy.lang.Closure closure = null)

java.lang.Object allocatePorts(groovy.lang.Closure cl = null)

java.lang.Object blockOn(java.lang.Iterable projectNames)

Block build if certain jobs are running true

java.lang.Object blockOn(java.lang.String projectName)

Block build if certain jobs are running.

java.lang.Object blockOnDownstreamProjects()

Configures the job to block when downstream projects are building.

java.lang.Object blockOnUpstreamProjects()

Configures the job to block when upstream projects are building.

java.lang.Object checkoutRetryCount(int times = 3)

Sets the number of times the SCM checkout is retried on errors.

java.lang.Object customWorkspace(java.lang.String workspacePath)

Configures a custom workspace for the project.

java.lang.Object description(java.lang.String descriptionString)

java.lang.Object disabled(boolean shouldDisable = true)

java.lang.Object displayName(java.lang.String displayName)

Sets a display name for the project.

java.lang.Object environmentVariables(groovy.lang.Closure envClosure)

Add environment variables to the build.

java.lang.Object environmentVariables(java.util.Map vars, groovy.lang.Closure envClosure = null)

java.lang.Object jdk(java.lang.String jdkArg)

Name of the JDK installation to use for this job.

java.lang.Object keepDependencies(boolean keep = true)

Configures the keep Dependencies Flag which can be set in the Fingerprinting action

java.lang.Object label(java.lang.String labelExpression = null)

java.lang.Object logRotator(int daysToKeepInt = -1, int numToKeepInt = -1, int artifactDaysToKeepInt = -1, int artifactNumToKeepInt = -1)

14 50 5 20

java.lang.Object priority(int value)

Priority of this job.

java.lang.Object quietPeriod(int seconds = 5)

Adds a quiet period to the project.

java.lang.Object runOnSameNodeAs(java.lang.String jobName, boolean useSameWorkspace = false)

test true Build the job on the same node as another job and optionally use the same workspace as the other job.

java.lang.Object rvm(java.lang.String rubySpecification)

Support for builds using a rvm environment.

java.lang.Object sshAgent(java.lang.String credentials)

25899f16-1b91-4656-90cd-3f1c26ef6292

java.lang.Object timeout(java.lang.Integer timeoutInMinutes, java.lang.Boolean shouldFailBuild = true)

java.lang.Object timeout(java.lang.String type = absolute.toString(, groovy.lang.Closure timeoutClosure = null)

Add a timeout to the build job.

 
Methods inherited from class AbstractHelper
execute
 

Property Detail

jobManagement

JobManagement jobManagement


labelAlreadyAdded

boolean labelAlreadyAdded
"Restrict where this project can be run" FullTools&&RPM&&DC
Parameters:
labelExpression - Label of node to use, if null is passed in, the label is cleared out and it can roam
Returns:


 
Constructor Detail

TopLevelHelper

TopLevelHelper(java.util.List withXmlActions, JobType jobType, JobManagement jobManagement)


 
Method Detail

allocatePorts

java.lang.Object allocatePorts(java.lang.String[] portsArg, groovy.lang.Closure closure = null)


allocatePorts

java.lang.Object allocatePorts(groovy.lang.Closure cl = null)


blockOn

java.lang.Object blockOn(java.lang.Iterable projectNames)
Block build if certain jobs are running true JobA


blockOn

java.lang.Object blockOn(java.lang.String projectName)
Block build if certain jobs are running.
Parameters:
projectName - Can be regular expressions. Newline delimited.
Returns:


blockOnDownstreamProjects

java.lang.Object blockOnDownstreamProjects()
Configures the job to block when downstream projects are building.
Returns:


blockOnUpstreamProjects

java.lang.Object blockOnUpstreamProjects()
Configures the job to block when upstream projects are building.
Returns:


checkoutRetryCount

java.lang.Object checkoutRetryCount(int times = 3)
Sets the number of times the SCM checkout is retried on errors.
Parameters:
times - number of attempts


customWorkspace

java.lang.Object customWorkspace(java.lang.String workspacePath)
Configures a custom workspace for the project.
Parameters:
workspacePath - workspace path to use


description

java.lang.Object description(java.lang.String descriptionString)


disabled

java.lang.Object disabled(boolean shouldDisable = true)


displayName

java.lang.Object displayName(java.lang.String displayName)
Sets a display name for the project.
Parameters:
displayName - name to display


environmentVariables

java.lang.Object environmentVariables(groovy.lang.Closure envClosure)
Add environment variables to the build. TEST=foo BAR=123 false true true true


environmentVariables

java.lang.Object environmentVariables(java.util.Map vars, groovy.lang.Closure envClosure = null)


jdk

java.lang.Object jdk(java.lang.String jdkArg)
Name of the JDK installation to use for this job.
Parameters:
jdkArg - name of the JDK installation to use for this job.


keepDependencies

java.lang.Object keepDependencies(boolean keep = true)
Configures the keep Dependencies Flag which can be set in the Fingerprinting action true


label

java.lang.Object label(java.lang.String labelExpression = null)


logRotator

java.lang.Object logRotator(int daysToKeepInt = -1, int numToKeepInt = -1, int artifactDaysToKeepInt = -1, int artifactNumToKeepInt = -1)
14 50 5 20 TODO - Let them specify a closure to fill a context object, I think it would nicer than a bunch of int args


priority

java.lang.Object priority(int value)
Priority of this job. Requires the Priority Sorter Plugin. Default value is 100. 100


quietPeriod

java.lang.Object quietPeriod(int seconds = 5)
Adds a quiet period to the project.
Parameters:
seconds - number of seconds to wait


runOnSameNodeAs

java.lang.Object runOnSameNodeAs(java.lang.String jobName, boolean useSameWorkspace = false)
test true Build the job on the same node as another job and optionally use the same workspace as the other job.
Parameters:
jobName - name of the job
useSameWorkspace - set to true to share the workspace with the given job


rvm

java.lang.Object rvm(java.lang.String rubySpecification)
Support for builds using a rvm environment.
Parameters:
rubySpecification - Specification of the required ruby version, optionally containing a gemset (i.e. ruby-1.9.3, ruby-2.0.0@gemset-foo) Generates XML: rvm ruby-1.9.2-p290


sshAgent

java.lang.Object sshAgent(java.lang.String credentials)
25899f16-1b91-4656-90cd-3f1c26ef6292 Provide SSH credentials to builds via a ssh-agent in Jenkins.
Parameters:
credentials - name of the credentials to use


timeout

java.lang.Object timeout(java.lang.Integer timeoutInMinutes, java.lang.Boolean shouldFailBuild = true)


timeout

java.lang.Object timeout(java.lang.String type = absolute.toString(, groovy.lang.Closure timeoutClosure = null)
Add a timeout to the build job. May be an absolute, elastic or likely Stuck timeout.
Parameters:
type - type of timeout defaults to absolute
timeoutClosure - optional closure for configuring the timeout


 

Groovy Documentation