CI build detail commands

6 minute readReference

For the specified CI build, use these API commands to manage CI build data from within CloudBees CD/RO:

  • Store CI build data in CloudBees CD/RO including code commit details, test results, and build artifacts.

  • Associate CI build data with a CloudBees CD/RO release, pipeline, or published artifact.

createCIBuildDetail

Creates a new CI build for a project.

Arguments Descriptions

projectName

The project with which the CI build detail object is associated.
Argument Type: String

ciBuildDetailName

The name of the CI build.
Argument Type: String

buildData

The build data from a CI job or a CI pipeline in JSON format.
Argument Type: String

buildTriggerSource

The source system which triggered this CI build. Specify CI or Flow.
Argument Type: BuildTriggerSource

ciBuildAssociationType

Represents how a CI build is associated with CloudBees CD/RO. Use attached, triggeredByFlow, or triggeredByCI.
Argument Type: CIBuildAssociationType

For use with pipeline run associations:

flowRuntimeId

(Required) The id of the CloudBees CD/RO runtime with which the CI build is associated. Use getPipelineRuntimes to get a list of runtime ids.

Argument Type: UUID

flowRuntimeStateId

The id of the flow runtime state that triggered the CI Build.

Argument Type: UUID

For use with release associations:

releaseName

(Required) The name of the release with which the CI build is associated.
Argument Type: String

releaseProjectName

The name of the project containing the release with which the CI build is associated. Required if releaseName is in a different project than ciBuildDetailName.

+ Argument Type: String

Positional arguments

projectName, ciBuildDetailName

Response

Returns a ciBuildDetailInfo object.

ec-perl

syntax: $cmdr->createCIBuildDetail (<projectName>, <ciBuildDetailName>, <flowRuntimeID>, <buildData>, <buildTriggerSource>, <ciBuildAssociationType>, {<optionals>});

Example

$cmdr->createCIBuildDetail ( projectName => "Test", ciBuildDetailName => "test_ci_build", flowRuntimeID => "e9bebbe3-c087-11e9-8bf5-001c42c3ce23", buildData => "<json-formatted CI build data>", buildTriggerSource => "CI", ciBuildAssociationType => `triggeredByCI` );

ectool

syntax: ectool createCIBuildDetail <projectName> <ciBuildDetailName> <flowRuntimeID> <buildData> <buildTriggerSource> <ciBuildAssociationType> [optionals]

Example

ectool createCIBuildDetail 'Test' 'test_ci_build' --buildTriggerSource 'CI' --flowRuntimeId 'e9bebbe3-c087-11e9-8bf5-001c42c3ce23' --buildData '{<json-formatted CI build data>}' --buildTriggerSource 'CI' --ciBuildAssociationType 'triggeredByCI'

deleteCIBuildDetail

Deletes a CI build object

Arguments Descriptions

projectName

The project with which the CI build detail object is associated.

Argument Type: String

ciBuildDetailName

The name of the CI build.

Argument Type: String

flowRuntimeId

(Optional) The id of the flow runtime to which the CI build should be associated with.

Argument Type: UUID

releaseName

(Optional) The name of the release that the CI build should be associated with.

Argument Type: String

releaseProjectName

(Optional) The name of the project that contains the release that the CI build should be associated with.

Argument Type: String

Positional arguments

projectName, ciBuildDetailName

Response

None.

ec-perl

syntax: $cmdr->deleteCIBuildDetail (<projectName>, <ciBuildDetailName>, {<optionals>});

Example

$cmdr->deleteCIBuildDetail ( projectName => "Test", ciBuildDetailName => "test_ci_build" );

ectool

syntax: ectool deleteCIBuildDetail <projectName> <ciBuildDetailName> [optionals]

Example

ectool deleteCIBuildDetail 'Test' 'test_ci_build'

getCIBuildDetail

Retrieve the specified CI build details.

Arguments Descriptions

projectName

The project with which the CI build detail object is associated.

Argument Type: String

ciBuildDetailName

The name of the CI build

Argument Type: String

For use with pipeline run associations:

flowRuntimeId

(Required) The id of the CloudBees CD/RO runtime with which the CI build is associated. Use getPipelineRuntimes to get a list of runtime ids.

Argument Type: UUID

For use with release associations:

flowRuntimeId

(Required) The id of the CloudBees CD/RO runtime with which the CI build is associated. Use getPipelineRuntimes to get a list of runtime ids. Available if releaseName not specified.

Argument Type: UUID

releaseName

(Required) The name of the release with which the CI build is associated. Available if flowRuntimeId no specified.

Argument Type: String

releaseProjectName

The name of the project containing the release with which the CI build is associated. Required if releaseName is in a different project than ciBuildDetailName.

Argument Type: String

Positional arguments

projectName, ciBuildDetailName

Response

Returns a ciBuildDetailInfo object.

ec-perl

syntax: $cmdr->getCIBuildDetail (<projectName>, <ciBuildDetailName>);

Example

$cmdr->getCIBuildDetail ( projectName => "Test", ciBuildDetailName => "test_ci_build" );

ectool

syntax: ectool getCIBuildDetail <projectName> <ciBuildDetailName>

Example

ectool getCIBuildDetail 'Test' 'test_ci_build'

getCIBuildDetails

Retrieve all CI builds.

Arguments Descriptions

projectName

The project with which the CI build detail object is associated.

Argument Type: String

For use with pipeline run associations:

flowRuntimeId

The id of the CloudBees CD/RO runtime with which the CI build is associated. Use getPipelineRuntimes to get a list of runtime ids.

Argument Type: UUID

For use with release associations:

excludeReleaseBuilds

Boolean flag0|1|true|false Whether to exclude CI builds associated with the release when retrieving CI builds for a specified release run.

Available only with flowRuntimeId.

Argument Type: Boolean

flowRuntimeId

The id of the CloudBees CD/RO runtime with which the CI build is associated. Use getPipelineRuntimes to get a list of runtime ids. Available if releaseName not specified.

Argument Type: UUID

releaseName

The name of the release with which the CI build is associated. Available if flowRuntimeId no specified.

Argument Type: String

releaseProjectName

The name of the project containing the release with which the CI build is associated. Required if releaseName is in a different project than ciBuildDetailName.

Argument Type: String

Positional arguments

None.

Response

Returns a list of ciBuildDetailInfo objects.

ec-perl

syntax: $cmdr->getCIBuildDetails (<projectName>);

Example

$cmdr->getCIBuildDetails ( projectName => "Test" );

ectool

syntax: ectool getCIBuildDetails <projectName>

Example

ectool getCIBuildDetais --projectName 'Test'

modifyCIBuildDetail

Modifies an existing CI build detail object.

Arguments Descriptions

projectName

The project with which the CI build detail object is associated.

Argument Type: String

ciBuildDetailName

The name of the CI build.

Argument Type: String

buildData

The build data from a CI job or a CI pipeline in JSON format.

Argument Type: String

buildTriggerSource

The source system which triggered this CI build. Specify CI or Flow.

Argument Type: BuildTriggerSource

ciBuildAssociationType

Represents how a CI build is associated with CloudBees CD/RO. Use attached, triggeredByFlow, or triggeredByCI. Use only if flowRuntimeId or releaseName is specified.

Argument Type: CIBuildAssociationType

newName

New name for this ciBuildDetailName.

For use with pipeline run associations:

flowRuntimeId

(Required) The id of the CloudBees CD/RO runtime with which the CI build is associated. Use getPipelineRuntimes to get a list of runtime ids.+ Argument Type: UUID

flowRuntimeStateId

The name of the stage which contains the flowRuntimeState that triggered the CI Build.

Argument Type: UUID

stageName

The name of the stage in a pipeline.

Argument Type: String

clearFlowRuntimes

(Optional) Boolean flag0|1|true|false
Set to true or 0 to clear references to all pipeline runs. Argument Type: Boolean

For use with release associations:

releaseName

(Required) The name of the release with which the CI build is associated.

Argument Type: String

releaseProjectName

The name of the project containing the release with which the CI build is associated. Required if releaseName is in a different project than ciBuildDetailName.

Argument Type: String

clearReleases

(Optional) Boolean flag0|1|true|false

Set to true or 0 to clear references to all releases.

Argument Type: Boolean

Positional arguments

projectName, ciBuildDetailName

Response

Returns a ciBuildDetailInfo object.

ec-perl

syntax: $cmdr->modifyCIBuildDetail (<projectName>, <ciBuildDetailName>, <flowRuntimeID>, <buildData>, <buildTriggerSource>, <ciBuildAssociationType>, {<optionals>});

Example

$cmdr->modifyCIBuildDetail ( projectName => "Test", ciBuildDetailName => "test_ci_build", flowRuntimeId => "e9bebbe3-c087-11e9-8bf5-001c42c3ce23", buildData => "<json-formatted CI build data>", buildTriggerSource => "CI", ciBuildAssociationType => `triggeredByCI` );

ectool

syntax: ectool modifyCIBuildDetail <projectName> <ciBuildDetailName> <flowRuntimeID> <buildData> <buildTriggerSource> <ciBuildAssociationType> [optionals]

Example

ectool modifyCIBuildDetail 'Test' 'test_ci_build' --buildTriggerSource 'CI' --flowRuntimeId 'e9bebbe3-c087-11e9-8bf5-001c42c3ce23' --buildData '{<json-formatted CI build data>}' --buildTriggerSource 'CI' --ciBuildAssociationType 'triggeredByCI'

setCIBuildDetail

This command is a wrapper for create/modifyCIBuildDetail API. It abstracts the logic for whether the build data needs to be created or, if it already exists, updated.

Arguments Descriptions

projectName

The project with which the CI build detail object is associated.
Argument Type: String

ciBuildDetailName

The name of the CI build.
Argument Type: String

buildData

The build data from a CI job or a CI pipeline in JSON format.
Argument Type: String

buildTriggerSource

The source system which triggered this CI build. Specify CI or Flow.
Argument Type: BuildTriggerSource

ciBuildAssociationType

Represents how a CI build is associated with CloudBees CD/RO. Use attached, triggeredByFlow, or triggeredByCI. Use only if flowRuntimeId or releaseName is specified.+ Argument Type: CIBuildAssociationType

For use with pipeline run associations:

flowRuntimeId

(Required) The id of the CloudBees CD/RO runtime with which the CI build is associated. getPipelineRuntimes to get a list of runtime ids.

Argument Type: UUID

flowRuntimeStateId

The name of the stage which contains the flowRuntimeState that triggered the CI Build.

Argument Type: UUID

stageName

The name of the stage in a pipeline.

Argument Type: String

clearFlowRuntimes

(Optional) Boolean flag0|1|true|false
Set to true or 0 to clear references to all pipeline runs.
Argument Type: Boolean

For use with release associations:

releaseName

(Required) The name of the release with which the CI build is associated.
Argument Type: String

releaseProjectName

The name of the project containing the release with which the CI build is associated. Required if releaseName is in a different project than ciBuildDetailName.

+ Argument Type: String

clearReleases

(Optional) Boolean flag0|1|true|false
Set to true or 0 to clear references to all releases.
Argument Type: Boolean

Positional arguments

projectName, ciBuildDetailName

Response

Returns a ciBuildDetailInfo object.

ec-perl

syntax: $cmdr->setCIBuildDetail (<projectName>, <ciBuildDetailName>, <flowRuntimeID>, <buildData>, <buildTriggerSource>, <ciBuildAssociationType>, {<optionals>});

Example

$cmdr->setCIBuildDetail ( projectName => "Test", ciBuildDetailName => "test_ci_build", flowRuntimeId => "e9bebbe3-c087-11e9-8bf5-001c42c3ce23", buildData => "<json-formatted CI build data>", buildTriggerSource => "CI", ciBuildAssociationType => `triggeredByCI` );

ectool

syntax: ectool setCIBuildDetail <projectName> <ciBuildDetailName> <flowRuntimeID> <buildData> <buildTriggerSource> <ciBuildAssociationType> [optionals]

Example

ectool setCIBuildDetail 'Test' 'test_ci_build' --buildTriggerSource 'CI' --flowRuntimeId 'e9bebbe3-c087-11e9-8bf5-001c42c3ce23' --buildData '{<json-formatted CI build data>}' --buildTriggerSource 'CI' --ciBuildAssociationType 'triggeredByCI'