Groovy Documentation

javaposse.jobdsl.dsl
[Groovy] Interface JobManagement


interface JobManagement

Interface to manage jobs, which the DSL needs to do.

Authors:
jryan
aharmel-law


Method Summary
boolean createOrUpdateConfig(java.lang.String jobName, java.lang.String config, boolean ignoreExisting)

Creates or updates the job config for the named Jenkins job with the config provided.

java.lang.String getConfig(java.lang.String jobName)

Gets (loads) the job configuration for the Jenkins job with the specified name.

java.lang.String getCredentialsId(java.lang.String credentialsDescription)

Returns the id of a Credentials object.

java.io.PrintStream getOutputStream()

Stream to write to, for stdout.

java.util.Map getParameters()

Map if variables that should be available to the script.

void queueJob(java.lang.String jobName)

Queue a job to run.

java.lang.String readFileInWorkspace(java.lang.String filePath)

java.io.InputStream streamFileInWorkspace(java.lang.String filePath)

 

Method Detail

createOrUpdateConfig

boolean createOrUpdateConfig(java.lang.String jobName, java.lang.String config, boolean ignoreExisting)
Creates or updates the job config for the named Jenkins job with the config provided.
throws:
JobNameNotProvidedException if the jobName is null or blank
throws:
JobConfigurationMissingException if the config xml is null or blank
Parameters:
jobName - the name of the new / updated job
config - the new / updated job config
ignoreExisting - do not update existing jobs


getConfig

java.lang.String getConfig(java.lang.String jobName)
Gets (loads) the job configuration for the Jenkins job with the specified name. If no name is supplied, an empty configuration is returned.
throws:
JobConfigurationNotFoundException
Parameters:
jobName - the name of the job to look up
Returns:
the job configuration as XML


getCredentialsId

java.lang.String getCredentialsId(java.lang.String credentialsDescription)
Returns the id of a Credentials object.
Parameters:
credentialsDescription - the description of the credentials to lookup
Returns:
id of Credentials or null if no credentials could be found


getOutputStream

java.io.PrintStream getOutputStream()
Stream to write to, for stdout.
Returns:
PrintWriter


getParameters

java.util.Map getParameters()
Map if variables that should be available to the script.


queueJob

void queueJob(java.lang.String jobName)
Queue a job to run. Useful for running jobs after they've been created.


readFileInWorkspace

java.lang.String readFileInWorkspace(java.lang.String filePath)


streamFileInWorkspace

java.io.InputStream streamFileInWorkspace(java.lang.String filePath)


 

Groovy Documentation