start_build
async
¶
start_build(
project_name: NonEmptyString,
*,
config_overrides: Optional[AsyncCodeBuildClientConfig] = None,
secondary_sources_override: Optional[ProjectSources] = None,
secondary_sources_version_override: Optional[ProjectSecondarySourceVersions] = None,
source_version: Optional[String] = None,
artifacts_override: Optional[ProjectArtifacts] = None,
secondary_artifacts_override: Optional[ProjectArtifactsList] = None,
environment_variables_override: Optional[EnvironmentVariables] = None,
source_type_override: Optional[SourceType] = None,
source_location_override: Optional[String] = None,
source_auth_override: Optional[SourceAuth] = None,
git_clone_depth_override: Optional[GitCloneDepth] = None,
git_submodules_config_override: Optional[GitSubmodulesConfig] = None,
buildspec_override: Optional[String] = None,
insecure_ssl_override: Optional[WrapperBoolean] = None,
report_build_status_override: Optional[WrapperBoolean] = None,
build_status_config_override: Optional[BuildStatusConfig] = None,
environment_type_override: Optional[EnvironmentType] = None,
image_override: Optional[NonEmptyString] = None,
compute_type_override: Optional[ComputeType] = None,
certificate_override: Optional[String] = None,
cache_override: Optional[ProjectCache] = None,
service_role_override: Optional[NonEmptyString] = None,
privileged_mode_override: Optional[WrapperBoolean] = None,
timeout_in_minutes_override: Optional[BuildTimeOut] = None,
queued_timeout_in_minutes_override: Optional[TimeOut] = None,
encryption_key_override: Optional[NonEmptyString] = None,
idempotency_token: Optional[String] = None,
logs_config_override: Optional[LogsConfig] = None,
registry_credential_override: Optional[RegistryCredential] = None,
image_pull_credentials_type_override: Optional[ImagePullCredentialsType] = None,
debug_session_enabled: Optional[WrapperBoolean] = None,
fleet_override: Optional[ProjectFleet] = None,
auto_retry_limit_override: Optional[WrapperInt] = None,
host_kernel_override: Optional[HostKernel] = None,
) -> StartBuildOutput
Starts running a build with the settings defined in the project. These setting include: how to run a build, where to get the source code, which build environment to use, which build commands to run, and where to store the build output.
You can also start a build run by overriding some of the build settings in the project. The overrides only apply for that specific start build request. The settings in the project are unaltered.
Parameters:
-
project_name(NonEmptyString) –The name of the CodeBuild build project to start running a build.
-
secondary_sources_override(Optional[ProjectSources], default:None) –An array of
ProjectSourceobjects. -
secondary_sources_version_override(Optional[ProjectSecondarySourceVersions], default:None) –An array of
ProjectSourceVersionobjects that specify one or more versions of the project's secondary sources to be used for this build only. -
source_version(Optional[String], default:None) –The version of the build input to be built, for this build only. If not specified, the latest version is used. If specified, the contents depends on the source provider:
- CodeCommit
-
The commit ID, branch, or Git tag to use.
- 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 examplepr/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. - GitLab
-
The commit ID, branch, or Git tag to use.
- 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.
- Amazon S3
-
The version ID of the object that represents the build input ZIP file to use.
If
sourceVersionis specified at the project level, then thissourceVersion(at the build level) takes precedence.For more information, see Source Version Sample with CodeBuild in the CodeBuild User Guide.
-
artifacts_override(Optional[ProjectArtifacts], default:None) –Build output artifact settings that override, for this build only, the latest ones already defined in the build project.
-
secondary_artifacts_override(Optional[ProjectArtifactsList], default:None) –An array of
ProjectArtifactsobjects. -
environment_variables_override(Optional[EnvironmentVariables], default:None) –A set of environment variables that overrides, for this build only, the latest ones already defined in the build project.
-
source_type_override(Optional[SourceType], default:None) –A source input type, for this build, that overrides the source input defined in the build project.
-
source_location_override(Optional[String], default:None) –A location that overrides, for this build, the source location for the one defined in the build project.
-
source_auth_override(Optional[SourceAuth], default:None) –An authorization type for this build that overrides the one defined in the build project. This override applies only if the build project's source is BitBucket, GitHub, GitLab, or GitLab Self Managed.
-
git_clone_depth_override(Optional[GitCloneDepth], default:None) –The user-defined depth of history, with a minimum value of 0, that overrides, for this build only, any previous depth of history defined in the build project.
-
git_submodules_config_override(Optional[GitSubmodulesConfig], default:None) –Information about the Git submodules configuration for this build of an CodeBuild build project.
-
buildspec_override(Optional[String], default:None) –A buildspec file declaration that overrides the latest one defined in the build project, for this build only. The buildspec defined on the project is not changed.
If this value is set, it can be either an inline buildspec definition, the path to an alternate buildspec file relative to the value of the built-in
CODEBUILD_SRC_DIRenvironment variable, or the path to an S3 bucket. The bucket must be in the same Amazon Web Services Region as the build project. Specify the buildspec file using its ARN (for example,arn:aws:s3:::my-codebuild-sample2/buildspec.yml). If this value is not provided or is set to an empty string, the source code must contain a buildspec file in its root directory. For more information, see Buildspec File Name and Storage Location.Since this property allows you to change the build commands that will run in the container, you should note that an IAM principal with the ability to call this API and set this parameter can override the default settings. Moreover, we encourage that you use a trustworthy buildspec location like a file in your source repository or a Amazon S3 bucket. Alternatively, you can restrict overrides to the buildspec by using a condition key: Prevent unauthorized modifications to project buildspec.
-
insecure_ssl_override(Optional[WrapperBoolean], default:None) –Enable this flag to override the insecure SSL setting that is specified in the build project. The insecure SSL setting determines whether to ignore SSL warnings while connecting to the project source code. This override applies only if the build's source is GitHub Enterprise.
-
report_build_status_override(Optional[WrapperBoolean], default:None) –Set to true to report to your source provider the status of a build's start and completion. If you use this option with a source provider other than GitHub, GitHub Enterprise, GitLab, GitLab Self Managed, or Bitbucket, an
invalidInputExceptionis thrown.To be able to report the build status to the source provider, the user associated with the source provider must have write access to the repo. If the user does not have write access, the build status cannot be updated. For more information, see Source provider access in the CodeBuild User Guide.
The status of a build triggered by a webhook is always reported to your source provider.
-
build_status_config_override(Optional[BuildStatusConfig], default:None) –Contains information that defines how the build project reports the build status to the source provider. This option is only used when the source provider is
GITHUB,GITHUB_ENTERPRISE, orBITBUCKET. -
environment_type_override(Optional[EnvironmentType], default:None) –A container type for this build that overrides the one specified in the build project.
-
image_override(Optional[NonEmptyString], default:None) –The name of an image for this build that overrides the one specified in the build project.
-
compute_type_override(Optional[ComputeType], default:None) –The name of a compute type for this build that overrides the one specified in the build project.
-
certificate_override(Optional[String], default:None) –The name of a certificate for this build that overrides the one specified in the build project.
-
cache_override(Optional[ProjectCache], default:None) –A ProjectCache object specified for this build that overrides the one defined in the build project.
-
service_role_override(Optional[NonEmptyString], default:None) –The name of a service role for this build that overrides the one specified in the build project.
-
privileged_mode_override(Optional[WrapperBoolean], default:None) –Enable this flag to override privileged mode in the build project.
-
timeout_in_minutes_override(Optional[BuildTimeOut], default:None) –The number of build timeout minutes, from 5 to 2160 (36 hours), that overrides, for this build only, the latest setting already defined in the build project.
-
queued_timeout_in_minutes_override(Optional[TimeOut], default:None) –The number of minutes a build is allowed to be queued before it times out.
-
encryption_key_override(Optional[NonEmptyString], default:None) –The Key Management Service customer master key (CMK) that overrides the one specified in the build project. The CMK key encrypts the build output artifacts.
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/). -
idempotency_token(Optional[String], default:None) –A unique, case sensitive identifier you provide to ensure the idempotency of the StartBuild request. The token is included in the StartBuild request and is valid for 5 minutes. If you repeat the StartBuild request with the same token, but change a parameter, CodeBuild returns a parameter mismatch error.
-
logs_config_override(Optional[LogsConfig], default:None) –Log settings for this build that override the log settings defined in the build project.
-
registry_credential_override(Optional[RegistryCredential], default:None) –The credentials for access to a private registry.
-
image_pull_credentials_type_override(Optional[ImagePullCredentialsType], default:None) –The type of credentials CodeBuild uses to pull images in your build. There are two valid values:
- CODEBUILD
-
Specifies that CodeBuild uses its own credentials. This requires that you modify your ECR repository policy to trust CodeBuild's service principal.
- SERVICE_ROLE
-
Specifies that CodeBuild uses your build project's service role.
When using a cross-account or private registry image, you must use
SERVICE_ROLEcredentials. When using an CodeBuild curated image, you must useCODEBUILDcredentials. -
debug_session_enabled(Optional[WrapperBoolean], default:None) –Specifies if session debugging is enabled for this build. For more information, see Viewing a running build in Session Manager.
-
fleet_override(Optional[ProjectFleet], default:None) –A ProjectFleet object specified for this build that overrides the one defined in the build project.
-
auto_retry_limit_override(Optional[WrapperInt], default:None) –The maximum number of additional automatic retries after a failed build. For example, if the auto-retry limit is set to 2, CodeBuild will call the
RetryBuildAPI to automatically retry your build for up to 2 additional times. -
host_kernel_override(Optional[HostKernel], default:None) –The host operating system kernel for this build that overrides the one specified in the build project.
Raises:
-
AccountLimitExceededException–An Amazon Web Services service limit was exceeded for the calling Amazon Web Services account.
-
InvalidInputException–The input value that was provided is not valid.
-
ResourceNotFoundException–The specified Amazon Web Services resource cannot be found.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_codebuild/_services/async_code_build.py
4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 | |