public class Job extends EntityPropertiesBuilder<JobProperties>
Stage
that 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.Constructor and Description |
---|
Job(Job copy) |
Job(String name,
BambooKey key)
Specify job with given name and key.
|
Job(String name,
String key)
Specify job with given name and key.
|
Modifier and Type | Method and Description |
---|---|
Job |
artifacts(Artifact... artifacts)
Adds provided
Artifact s to the list of artifacts produced by the job. |
Job |
artifactSubscriptions(ArtifactSubscription... subscriptions)
Add artifact subscriptions.
|
protected JobProperties |
build() |
Job |
cleanWorkingDirectory(boolean cleanWorkingDirectory)
Specifies if job should clean working directory after executing.
|
Job |
description(String description)
Sets the job's description.
|
Job |
dockerConfiguration(DockerConfiguration dockerConfiguration)
Configure Docker for this job.
|
Job |
enabled(boolean enabled)
Enables/disables the job.
|
Job |
finalTasks(Task<?,?>... finalTasks)
Adds provided
Task s to the list of the final tasks executed by the job. |
BambooKey |
getKey()
Returns job's key, which serves as identifier for this object.
|
Job |
key(BambooKey key)
Sets the job's key.
|
Job |
key(String key)
Sets the job's key.
|
Job |
name(String name)
Sets the job's name.
|
Job |
noPluginConfigurations()
Deprecated.
|
Job |
pluginConfigurations(PluginConfiguration<?>... pluginConfigurations)
Appends plugin configuration to the plan.
|
Job |
requirements(Requirement... requirements)
Adds custom requirements to the job.
|
Job |
tasks(Task<?,?>... tasks)
Adds provided
Task s to the list of tasks executed by the job. |
public Job(@NotNull Job copy)
public Job(@NotNull String name, @NotNull String key) throws PropertiesValidationException
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.
name
- job's namekey
- job's short key, must be unique within the plan.PropertiesValidationException
public Job(@NotNull String name, @NotNull BambooKey key) throws PropertiesValidationException
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.
name
- job's namekey
- job's short key, must be unique within the plan.PropertiesValidationException
public Job name(@NotNull String name) throws PropertiesValidationException
PropertiesValidationException
public Job key(@NotNull String key) throws PropertiesValidationException
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.
key
- job's short key, must be unique within the plan.PropertiesValidationException
public Job key(@NotNull BambooKey key) throws PropertiesValidationException
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.
key
- job's short key, must be unique within the plan.PropertiesValidationException
public Job description(@Nullable String description) throws PropertiesValidationException
PropertiesValidationException
public Job enabled(boolean enabled) throws PropertiesValidationException
PropertiesValidationException
public Job artifacts(@NotNull Artifact... artifacts)
Artifact
s to the list of artifacts produced by the job.public Job artifactSubscriptions(@NotNull ArtifactSubscription... subscriptions)
Artifact subscription specify which subsequent jobs rely on this artifact.
public Job tasks(@NotNull Task<?,?>... tasks)
Task
s to the list of tasks executed by the job.public Job finalTasks(@NotNull Task<?,?>... finalTasks)
Task
s 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.
public Job requirements(Requirement... requirements)
Requirements control which Bamboo agents are able to execute the job.
public Job cleanWorkingDirectory(boolean cleanWorkingDirectory)
public Job pluginConfigurations(@NotNull PluginConfiguration<?>... pluginConfigurations)
@Deprecated public Job noPluginConfigurations()
public Job dockerConfiguration(@NotNull DockerConfiguration dockerConfiguration)
DockerConfiguration
@NotNull public BambooKey getKey()
IllegalStateException
- if key is undefinedprotected JobProperties build() throws PropertiesValidationException
build
in class EntityPropertiesBuilder<JobProperties>
PropertiesValidationException
Copyright © 2020 Atlassian Software Systems Pty Ltd. All rights reserved.