• 沒有找到結果。

Data Types

在文檔中 AWS CodeBuild (頁 182-200)

The AWS CodeBuild API contains several data types that various actions use. This section describes each data type in detail.

NoteThe order of each element in a data type structure is not guaranteed. Applications should not assume a particular order.

The following data types are supported:

• BatchRestrictions (p. 173)

• Build (p. 174)

• BuildArtifacts (p. 180)

• BuildBatch (p. 182)

• BuildBatchFilter (p. 187)

• BuildBatchPhase (p. 188)

• BuildGroup (p. 190)

• BuildNotDeleted (p. 192)

• BuildPhase (p. 193)

• BuildStatusConfig (p. 196)

• BuildSummary (p. 197)

• CloudWatchLogsConfig (p. 199)

• CodeCoverage (p. 200)

• CodeCoverageReportSummary (p. 202)

• DebugSession (p. 204)

• EnvironmentImage (p. 205)

• EnvironmentLanguage (p. 206)

• EnvironmentPlatform (p. 207)

• EnvironmentVariable (p. 208)

• ExportedEnvironmentVariable (p. 210)

• GitSubmodulesConfig (p. 211)

• LogsConfig (p. 212)

• LogsLocation (p. 213)

• NetworkInterface (p. 215)

• PhaseContext (p. 216)

• Project (p. 217)

• ProjectArtifacts (p. 222)

• ProjectBadge (p. 226)

• ProjectBuildBatchConfig (p. 227)

• ProjectCache (p. 229)

• ProjectEnvironment (p. 231)

• ProjectFileSystemLocation (p. 234)

• ProjectSource (p. 236)

• ProjectSourceVersion (p. 239)

• RegistryCredential (p. 240)

• Report (p. 241)

• ReportExportConfig (p. 244)

• ReportFilter (p. 245)

• ReportGroup (p. 246)

• ReportGroupTrendStats (p. 248)

• ReportWithRawData (p. 249)

• ResolvedArtifact (p. 250)

• S3LogsConfig (p. 251)

• S3ReportExportConfig (p. 253)

• SourceAuth (p. 255)

• SourceCredentialsInfo (p. 256)

• Tag (p. 257)

• TestCase (p. 258)

• TestCaseFilter (p. 260)

• TestReportSummary (p. 261)

• VpcConfig (p. 262)

• Webhook (p. 263)

• WebhookFilter (p. 265)

BatchRestrictions

BatchRestrictions

Specifies restrictions for the batch build.

Contents

NoteIn the following list, the required parameters are described first.

computeTypesAllowed

An array of strings that specify the compute types that are allowed for the batch build. See Build environment compute types in the AWS CodeBuild User Guide for these values.

Type: Array of strings

Length Constraints: Minimum length of 1.

Required: No maximumBuildsAllowed

Specifies the maximum number of builds allowed.

Type: Integer Required: No

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for Ruby V3

Build

Build

Information about a build.

Contents

Note

In the following list, the required parameters are described first.

arn

The Amazon Resource Name (ARN) of the build.

Type: String

Length Constraints: Minimum length of 1.

Required: No artifacts

Information about the output artifacts for the build.

Type: BuildArtifacts (p. 180) object Required: No

buildBatchArn

The ARN of the batch build that this build is a member of, if applicable.

Type: String Required: No buildComplete

Whether the build is complete. True if complete; otherwise, false.

Type: Boolean Required: No buildNumber

The number of the build. For each project, the buildNumber of its first build is 1. The

buildNumber of each subsequent build is incremented by 1. If a build is deleted, the buildNumber of other builds does not change.

Type: Long Required: No buildStatus

The current status of the build. Valid values include:

• FAILED: The build failed.

• FAULT: The build faulted.

• IN_PROGRESS: The build is still in progress.

• STOPPED: The build stopped.

• SUCCEEDED: The build succeeded.

• TIMED_OUT: The build timed out.

Contents

Type: String

Valid Values: SUCCEEDED | FAILED | FAULT | TIMED_OUT | IN_PROGRESS | STOPPED Required: No

cache

Information about the cache for the build.

Type: ProjectCache (p. 229) object Required: No

currentPhase

The current build phase.

Type: String Required: No debugSession

Contains information about the debug session for this build.

Type: DebugSession (p. 204) object Required: No

encryptionKey

The AWS Key Management Service customer master key (CMK) to be used for encrypting the build output artifacts.

NoteYou can use a cross-account KMS key to encrypt the build output artifacts if your service role has permission to that key.

You can specify either the Amazon Resource Name (ARN) of the CMK or, if available, the CMK's alias (using the format alias/<alias-name>).

Type: String

Length Constraints: Minimum length of 1.

Required: No endTime

When the build process ended, expressed in Unix time format.

Type: Timestamp Required: No environment

Information about the build environment for this build.

Type: ProjectEnvironment (p. 231) object Required: No

exportedEnvironmentVariables

A list of exported environment variables for this build.

Contents

Exported environment variables are used in conjunction with CodePipeline to export environment variables from the current build stage to subsequent stages in the pipeline. For more information, see Working with variables in the CodePipeline User Guide.

Type: Array of ExportedEnvironmentVariable (p. 210) objects Required: No

fileSystemLocations

An array of ProjectFileSystemLocation objects for a CodeBuild build project. A

ProjectFileSystemLocation object specifies the identifier, location, mountOptions, mountPoint, and type of a file system created using Amazon Elastic File System.

Type: Array of ProjectFileSystemLocation (p. 234) objects Required: No

id

The unique ID for the build.

Type: String

Length Constraints: Minimum length of 1.

Required: No initiator

The entity that started the build. Valid values include:

• If CodePipeline started the build, the pipeline's name (for example, codepipeline/my-demo-pipeline).

• If an IAM user started the build, the user's name (for example, MyUserName).

• If the Jenkins plugin for AWS CodeBuild started the build, the string CodeBuild-Jenkins-Plugin.

Type: String Required: No logs

Information about the build's logs in CloudWatch Logs.

Type: LogsLocation (p. 213) object Required: No

networkInterface

Describes a network interface.

Type: NetworkInterface (p. 215) object Required: No

phases

Information about all previous build phases that are complete and information about any current build phase that is not yet complete.

Type: Array of BuildPhase (p. 193) objects Required: No

Contents

projectName

The name of the AWS CodeBuild project.

Type: String

Length Constraints: Minimum length of 1.

Required: No

queuedTimeoutInMinutes

The number of minutes a build is allowed to be queued before it times out.

Type: Integer Required: No reportArns

An array of the ARNs associated with this build's reports.

Type: Array of strings Required: No

resolvedSourceVersion

An identifier for the version of this build's source code.

• For CodeCommit, GitHub, GitHub Enterprise, and BitBucket, the commit ID.

• For CodePipeline, the source revision provided by CodePipeline.

• For Amazon S3, this does not apply.

Type: String

Length Constraints: Minimum length of 1.

Required: No secondaryArtifacts

An array of ProjectArtifacts objects.

Type: Array of BuildArtifacts (p. 180) objects

Array Members: Minimum number of 0 items. Maximum number of 12 items.

Required: No secondarySources

An array of ProjectSource objects.

Type: Array of ProjectSource (p. 236) objects

Array Members: Minimum number of 0 items. Maximum number of 12 items.

Required: No

secondarySourceVersions

An array of ProjectSourceVersion objects. Each ProjectSourceVersion must be one of:

• For CodeCommit: the commit ID, branch, or Git tag to use.

• For GitHub: the commit ID, pull request ID, branch name, or tag name that corresponds to the version of the source code you want to build. If a pull request ID is specified, it must use the

Contents

format pr/pull-request-ID (for example, pr/25). If a branch name is specified, the branch's HEAD commit ID is used. If not specified, the default branch's HEAD commit ID is used.

• For Bitbucket: the commit ID, branch name, or tag name that corresponds to the version of the source code you want to build. If a branch name is specified, the branch's HEAD commit ID is used.

If not specified, the default branch's HEAD commit ID is used.

• For Amazon S3: the version ID of the object that represents the build input ZIP file to use.

Type: Array of ProjectSourceVersion (p. 239) objects

Array Members: Minimum number of 0 items. Maximum number of 12 items.

Required: No serviceRole

The name of a service role used for this build.

Type: String

Length Constraints: Minimum length of 1.

Required: No source

Information about the source code to be built.

Type: ProjectSource (p. 236) object Required: No

sourceVersion

Any version identifier for the version of the source code to be built. If sourceVersion is specified at the project level, then this sourceVersion (at the build level) takes precedence.

For more information, see Source Version Sample with CodeBuild in the AWS CodeBuild User Guide.

Type: String

Length Constraints: Minimum length of 1.

Required: No startTime

When the build process started, expressed in Unix time format.

Type: Timestamp Required: No timeoutInMinutes

How long, in minutes, for AWS CodeBuild to wait before timing out this build if it does not get marked as completed.

Type: Integer Required: No vpcConfig

If your AWS CodeBuild project accesses resources in an Amazon VPC, you provide this parameter that identifies the VPC ID and the list of security group IDs and subnet IDs. The security groups and

See Also

subnets must belong to the same VPC. You must provide at least one security group and one subnet ID.

Type: VpcConfig (p. 262) object Required: No

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for Ruby V3

BuildArtifacts

BuildArtifacts

Information about build output artifacts.

Contents

NoteIn the following list, the required parameters are described first.

artifactIdentifier

An identifier for this artifact definition.

Type: String Required: No bucketOwnerAccess

Specifies the bucket owner's access for objects that another account uploads to their Amazon S3 bucket. By default, only the account that uploads the objects to the bucket has access to these objects. This property allows you to give the bucket owner access to these objects.

NoteTo use this property, your CodeBuild service role must have the s3:PutBucketAcl permission. This permission allows CodeBuild to modify the access control list for the bucket.

This property can be one of the following values:

NONE

The bucket owner does not have access to the objects. This is the default.

READ_ONLY

The bucket owner has read-only access to the objects. The uploading account retains ownership of the objects.

FULL

The bucket owner has full access to the objects. Object ownership is determined by the following criteria:

• If the bucket is configured with the Bucket owner preferred setting, the bucket owner owns the objects. The uploading account will have object access as specified by the bucket's policy.

• Otherwise, the uploading account retains ownership of the objects.

For more information about Amazon S3 object ownership, see Controlling ownership of uploaded objects using S3 Object Ownership in the Amazon Simple Storage Service User Guide.

Type: String

Valid Values: NONE | READ_ONLY | FULL Required: No

encryptionDisabled

Information that tells you if encryption for build artifacts is disabled.

Type: Boolean Required: No

See Also

location

Information about the location of the build artifacts.

Type: String Required: No md5sum

The MD5 hash of the build artifact.

You can use this hash along with a checksum tool to confirm file integrity and authenticity.

NoteThis value is available only if the build project's packaging value is set to ZIP.

Type: String Required: No overrideArtifactName

If this flag is set, a name specified in the buildspec file overrides the artifact name. The name specified in a buildspec file is calculated at build time and uses the Shell Command Language. For example, you can append a date and time to your artifact name so that it is always unique.

Type: Boolean Required: No sha256sum

The SHA-256 hash of the build artifact.

You can use this hash along with a checksum tool to confirm file integrity and authenticity.

Note

This value is available only if the build project's packaging value is set to ZIP.

Type: String Required: No

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for Ruby V3

BuildBatch

BuildBatch

Contains information about a batch build.

Contents

Note

In the following list, the required parameters are described first.

arn

The ARN of the batch build.

Type: String

Length Constraints: Minimum length of 1.

Required: No artifacts

A BuildArtifacts object the defines the build artifacts for this batch build.

Type: BuildArtifacts (p. 180) object Required: No

buildBatchConfig

Contains configuration information about a batch build project.

Type: ProjectBuildBatchConfig (p. 227) object Required: No

buildBatchNumber

The number of the batch build. For each project, the buildBatchNumber of its first batch build is 1. The buildBatchNumber of each subsequent batch build is incremented by 1. If a batch build is deleted, the buildBatchNumber of other batch builds does not change.

Type: Long Required: No buildBatchStatus

The status of the batch build.

Type: String

Valid Values: SUCCEEDED | FAILED | FAULT | TIMED_OUT | IN_PROGRESS | STOPPED Required: No

buildGroups

An array of BuildGroup objects that define the build groups for the batch build.

Type: Array of BuildGroup (p. 190) objects Required: No

Contents

buildTimeoutInMinutes

Specifies the maximum amount of time, in minutes, that the build in a batch must be completed in.

Type: Integer Required: No cache

Information about the cache for the build project.

Type: ProjectCache (p. 229) object Required: No

complete

Indicates if the batch build is complete.

Type: Boolean Required: No currentPhase

The current phase of the batch build.

Type: String Required: No debugSessionEnabled

Specifies if session debugging is enabled for this batch build. For more information, see Viewing a running build in Session Manager. Batch session debugging is not supported for matrix batch builds.

Type: Boolean Required: No encryptionKey

The AWS Key Management Service customer master key (CMK) to be used for encrypting the batch build output artifacts.

Note

You can use a cross-account KMS key to encrypt the build output artifacts if your service role has permission to that key.

You can specify either the Amazon Resource Name (ARN) of the CMK or, if available, the CMK's alias (using the format alias/<alias-name>).

Type: String

Length Constraints: Minimum length of 1.

Required: No endTime

The date and time that the batch build ended.

Type: Timestamp Required: No

Contents

environment

Information about the build environment of the build project.

Type: ProjectEnvironment (p. 231) object Required: No

fileSystemLocations

An array of ProjectFileSystemLocation objects for the batch build project. A

ProjectFileSystemLocation object specifies the identifier, location, mountOptions, mountPoint, and type of a file system created using Amazon Elastic File System.

Type: Array of ProjectFileSystemLocation (p. 234) objects Required: No

id

The identifier of the batch build.

Type: String

Length Constraints: Minimum length of 1.

Required: No initiator

The entity that started the batch build. Valid values include:

• If CodePipeline started the build, the pipeline's name (for example, codepipeline/my-demo-pipeline).

• If an IAM user started the build, the user's name.

• If the Jenkins plugin for AWS CodeBuild started the build, the string CodeBuild-Jenkins-Plugin.

Type: String Required: No logConfig

Information about logs for a build project. These can be logs in CloudWatch Logs, built in a specified S3 bucket, or both.

Type: LogsConfig (p. 212) object Required: No

phases

An array of BuildBatchPhase objects the specify the phases of the batch build.

Type: Array of BuildBatchPhase (p. 188) objects Required: No

projectName

The name of the batch build project.

Type: String

Length Constraints: Minimum length of 1.

Contents

Required: No

queuedTimeoutInMinutes

Specifies the amount of time, in minutes, that the batch build is allowed to be queued before it times out.

Type: Integer Required: No resolvedSourceVersion

The identifier of the resolved version of this batch build's source code.

• For CodeCommit, GitHub, GitHub Enterprise, and BitBucket, the commit ID.

• For CodePipeline, the source revision provided by CodePipeline.

• For Amazon S3, this does not apply.

Type: String

Length Constraints: Minimum length of 1.

Required: No secondaryArtifacts

An array of BuildArtifacts objects the define the build artifacts for this batch build.

Type: Array of BuildArtifacts (p. 180) objects

Array Members: Minimum number of 0 items. Maximum number of 12 items.

Required: No secondarySources

An array of ProjectSource objects that define the sources for the batch build.

Type: Array of ProjectSource (p. 236) objects

Array Members: Minimum number of 0 items. Maximum number of 12 items.

Required: No

secondarySourceVersions

An array of ProjectSourceVersion objects. Each ProjectSourceVersion must be one of:

• For CodeCommit: the commit ID, branch, or Git tag to use.

• For GitHub: the commit ID, pull request ID, branch name, or tag name that corresponds to the version of the source code you want to build. If a pull request ID is specified, it must use the format pr/pull-request-ID (for example, pr/25). If a branch name is specified, the branch's HEAD commit ID is used. If not specified, the default branch's HEAD commit ID is used.

• For Bitbucket: the commit ID, branch name, or tag name that corresponds to the version of the source code you want to build. If a branch name is specified, the branch's HEAD commit ID is used.

If not specified, the default branch's HEAD commit ID is used.

• For Amazon S3: the version ID of the object that represents the build input ZIP file to use.

Type: Array of ProjectSourceVersion (p. 239) objects

Array Members: Minimum number of 0 items. Maximum number of 12 items.

Required: No

See Also

serviceRole

The name of a service role used for builds in the batch.

Type: String

Length Constraints: Minimum length of 1.

Required: No source

Information about the build input source code for the build project.

Type: ProjectSource (p. 236) object Required: No

sourceVersion

The identifier of the version of the source code to be built.

Type: String

Length Constraints: Minimum length of 1.

Required: No startTime

The date and time that the batch build started.

Type: Timestamp Required: No vpcConfig

Information about the VPC configuration that AWS CodeBuild accesses.

Type: VpcConfig (p. 262) object Required: No

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for Ruby V3

BuildBatchFilter

BuildBatchFilter

Specifies filters when retrieving batch builds.

Contents

NoteIn the following list, the required parameters are described first.

status

The status of the batch builds to retrieve. Only batch builds that have this status will be retrieved.

Type: String

Valid Values: SUCCEEDED | FAILED | FAULT | TIMED_OUT | IN_PROGRESS | STOPPED Required: No

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for Ruby V3

BuildBatchPhase

BuildBatchPhase

Contains information about a stage for a batch build.

Contents

NoteIn the following list, the required parameters are described first.

contexts

Additional information about the batch build phase. Especially to help troubleshoot a failed batch build.

Type: Array of PhaseContext (p. 216) objects Required: No

durationInSeconds

How long, in seconds, between the starting and ending times of the batch build's phase.

Type: Long Required: No endTime

When the batch build phase ended, expressed in Unix time format.

Type: Timestamp Required: No phaseStatus

The current status of the batch build phase. Valid values include:

FAILED

The build phase failed.

FAULT

The build phase faulted.

IN_PROGRESS

The build phase is still in progress.

STOPPED

The build phase stopped.

SUCCEEDED

The build phase succeeded.

TIMED_OUT

The build phase timed out.

Type: String

Valid Values: SUCCEEDED | FAILED | FAULT | TIMED_OUT | IN_PROGRESS | STOPPED

See Also

Required: No phaseType

The name of the batch build phase. Valid values include:

COMBINE_ARTIFACTS

Build output artifacts are being combined and uploaded to the output location.

DOWNLOAD_BATCHSPEC

The batch build specification is being downloaded.

FAILED

One or more of the builds failed.

IN_PROGRESS

The batch build is in progress.

STOPPED

The batch build was stopped.

SUBMITTED

The btach build has been submitted.

SUCCEEDED

The batch build succeeded.

Type: String

Valid Values: SUBMITTED | DOWNLOAD_BATCHSPEC | IN_PROGRESS | COMBINE_ARTIFACTS

| SUCCEEDED | FAILED | STOPPED Required: No

startTime

When the batch build phase started, expressed in Unix time format.

When the batch build phase started, expressed in Unix time format.

在文檔中 AWS CodeBuild (頁 182-200)

相關文件