Class Job
- java.lang.Object
-
- com.atlassian.bamboo.specs.api.builders.EntityPropertiesBuilder<JobProperties>
-
- com.atlassian.bamboo.specs.api.builders.plan.Job
-
public class Job extends EntityPropertiesBuilder<JobProperties>
Represents a Bamboo job. Job is a unit of work withinStagethat can be run parallel to other jobs if multiple agents are available. When executing several jobs on single agents, order in which jobs from single stage are executed is not defined.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Jobartifacts(@NotNull Artifact... artifacts)Adds providedArtifacts to the list of artifacts produced by the job.JobartifactSubscriptions(@NotNull ArtifactSubscription... subscriptions)Add artifact subscriptions.protected JobPropertiesbuild()JobcleanWorkingDirectory(boolean cleanWorkingDirectory)Specifies if job should clean working directory after executing.Jobdescription(@Nullable java.lang.String description)Sets the job's description.JobdockerConfiguration(@NotNull DockerConfiguration dockerConfiguration)Configure Docker for this job.Jobenabled(boolean enabled)Enables/disables the job.JobfinalTasks(@NotNull Task<?,?>... finalTasks)Adds providedTasks to the list of the final tasks executed by the job.@NotNull BambooKeygetKey()Returns job's key, which serves as identifier for this object.Jobkey(@NotNull BambooKey key)Sets the job's key.Jobkey(@NotNull java.lang.String key)Sets the job's key.Jobname(@NotNull java.lang.String name)Sets the job's name.JobnoPluginConfigurations()Deprecated.JobpluginConfigurations(@NotNull PluginConfiguration<?>... pluginConfigurations)Appends plugin configuration to the plan.Jobrequirements(Requirement... requirements)Adds custom requirements to the job.Jobtasks(@NotNull Task<?,?>... tasks)Adds providedTasks to the list of tasks executed by the job.
-
-
-
Constructor Detail
-
Job
public Job(@NotNull @NotNull Job copy)
-
Job
public Job(@NotNull @NotNull java.lang.String name, @NotNull @NotNull java.lang.String key) throws PropertiesValidationExceptionSpecify job with given name and key.If oid is not specified, key serves as a job identifier. If a job with specified key does not exist, a new one is created. If it does exists it is updated, it can also be moved between stages.
- Parameters:
name- job's namekey- job's short key, must be unique within the plan.- Throws:
PropertiesValidationException
-
Job
public Job(@NotNull @NotNull java.lang.String name, @NotNull @NotNull BambooKey key) throws PropertiesValidationExceptionSpecify job with given name and key.If oid is not specified, key serves as a job identifier. If a job with specified key does not exist, a new one is creted. If it does exists it is updated, it can also be moved between stages.
- Parameters:
name- job's namekey- job's short key, must be unique within the plan.- Throws:
PropertiesValidationException
-
-
Method Detail
-
name
public Job name(@NotNull @NotNull java.lang.String name) throws PropertiesValidationException
Sets the job's name.- Throws:
PropertiesValidationException
-
key
public Job key(@NotNull @NotNull java.lang.String key) throws PropertiesValidationException
Sets the job's key.If oid is not specified, key serves as a job identifier. If a job with specified key does not exist, a new one is created. If it does exists it is updated, it can also be moved between stages.
- Parameters:
key- job's short key, must be unique within the plan.- Throws:
PropertiesValidationException
-
key
public Job key(@NotNull @NotNull BambooKey key) throws PropertiesValidationException
Sets the job's key.If oid is not specified, key serves as a job identifier. If a job with specified key does not exist, a new one is created. If it does exists it is updated, in particular it can be moved between stages.
- Parameters:
key- job's short key, must be unique within the plan.- Throws:
PropertiesValidationException
-
description
public Job description(@Nullable @Nullable java.lang.String description) throws PropertiesValidationException
Sets the job's description.- Throws:
PropertiesValidationException
-
enabled
public Job enabled(boolean enabled) throws PropertiesValidationException
Enables/disables the job.- Throws:
PropertiesValidationException
-
artifacts
public Job artifacts(@NotNull @NotNull Artifact... artifacts)
Adds providedArtifacts to the list of artifacts produced by the job.
-
artifactSubscriptions
public Job artifactSubscriptions(@NotNull @NotNull ArtifactSubscription... subscriptions)
Add artifact subscriptions. Subscription can only be defined for shared artifacts.Artifact subscription specify which subsequent jobs rely on this artifact.
-
tasks
public Job tasks(@NotNull @NotNull Task<?,?>... tasks)
Adds providedTasks to the list of tasks executed by the job.
-
finalTasks
public Job finalTasks(@NotNull @NotNull Task<?,?>... finalTasks)
Adds providedTasks to the list of the final tasks executed by the job.Final tasks for a job are always executed, even if previous tasks in the job failed.
-
requirements
public Job requirements(Requirement... requirements)
Adds custom requirements to the job.Requirements control which Bamboo agents are able to execute the job.
-
cleanWorkingDirectory
public Job cleanWorkingDirectory(boolean cleanWorkingDirectory)
Specifies if job should clean working directory after executing.
-
pluginConfigurations
public Job pluginConfigurations(@NotNull @NotNull PluginConfiguration<?>... pluginConfigurations)
Appends plugin configuration to the plan. If the same plugin is specified second time, its configuration is overwritten.
-
noPluginConfigurations
@Deprecated public Job noPluginConfigurations()
Deprecated.Use this method to specify that your job has default plugins configuration.
-
dockerConfiguration
public Job dockerConfiguration(@NotNull @NotNull DockerConfiguration dockerConfiguration)
Configure Docker for this job.- See Also:
DockerConfiguration
-
getKey
@NotNull public @NotNull BambooKey getKey()
Returns job's key, which serves as identifier for this object.- Throws:
java.lang.IllegalStateException- if key is undefined
-
build
protected JobProperties build() throws PropertiesValidationException
- Specified by:
buildin classEntityPropertiesBuilder<JobProperties>- Throws:
PropertiesValidationException
-
-