public class StartJobTask extends Task
Usage :
Include the jar file containing JenkinsAPI and StartJobTask classes in your Ant file :
<path id="jenkins.cli.path"> <fileset dir="[jenkins_cli_directory]"> <include name="jenkins-cli.jar"/> </fileset> </path>Define a task to start jobs :
<taskdef name="startjob" classname="com.microej.tool.jenkinscli.ant.StartJobTask" classpathref="jenkins.cli.path"/>Start a job with required properties and parameters :
<startjob userName="[user_name]" userToken="[user_token]" jenkinsUrl="[jenkins_url]" jobName="[jobname]" > <stringParameter name="[string_param_name]" string="[string]"/> <fileParameter name="[file_param_name]" file="[file_location]"/> </startjob>
Constructor and Description |
---|
StartJobTask() |
Modifier and Type | Method and Description |
---|---|
JenkinsAPI.FileParameter |
createFileParameter()
Allows Ant to create a FileParameter.
|
JenkinsAPI.StringParameter |
createStringParameter()
Allows Ant to create a StringParameter.
|
void |
execute()
Called by Ant.
|
void |
setJenkinsUrl(String jenkinsUrl)
Sets the Jenkins URL.
|
void |
setJobName(String jobName)
Sets the job name.
|
void |
setUserName(String userName)
Sets the user name.
|
void |
setUserToken(String userToken)
Sets the user token.
|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
public JenkinsAPI.FileParameter createFileParameter()
public JenkinsAPI.StringParameter createStringParameter()
public void execute()
public void setJenkinsUrl(String jenkinsUrl)
jenkinsUrl
- The Jenkins URL.public void setJobName(String jobName)
jobName
- The job name.public void setUserName(String userName)
userName
- The user name.public void setUserToken(String userToken)
userToken
- The user token.