diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index c767322..b9c47e8 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 346792d..0778da5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: strategy: max-parallel: 10 matrix: - php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] + php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] steps: - name: Set up PHP @@ -23,7 +23,7 @@ jobs: coverage: none - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Initialize tests run: make initialize diff --git a/CHANGELOG.md b/CHANGELOG.md index fb174de..86ab357 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,64 @@ ## NOT RELEASED +## 2.11.1 + +### Changed + +- AWS enhancement: Documentation updates. + +## 2.11.0 + +### Added + +- AWS api-change: AWS CodeBuild now supports Docker Server capability + +## 2.10.0 + +### Added + +- AWS api-change: This release adds support for environment type WINDOWS_SERVER_2022_CONTAINER in ProjectEnvironment +- AWS api-change: Added `us-isob-east-1` region. +- AWS api-change: Add support for custom instance type for reserved capacity fleets + +### Changed + +- Sort exception alphabetically. + +## 2.9.0 + +### Added + +- AWS api-change: This release adds support for cacheNamespace in ProjectCache + +### Changed + +- AWS enhancement: Documentation updates. + +## 2.8.0 + +### Added + +- AWS api-change: Added `us-isof-east-1` and `us-isof-south-1` regions + +## 2.7.0 + +### Added + +- AWS api-change: Added `us-iso-east-1` and `us-iso-west-1` regions. + +### Changed + +- AWS enhancement: Documentation updates. + +## 2.6.0 + +### Added + +- AWS api-change: AWS CodeBuild now supports automatically retrying failed builds +- AWS api-change: AWS CodeBuild now adds additional compute types for reserved capacity fleet. +- AWS api-change: AWS CodeBuild now supports non-containerized Linux and Windows builds on Reserved Capacity. + ## 2.5.0 ### Added diff --git a/composer.json b/composer.json index 4577409..b654fb3 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ }, "extra": { "branch-alias": { - "dev-master": "2.5-dev" + "dev-master": "2.11-dev" } } } diff --git a/src/CodeBuildClient.php b/src/CodeBuildClient.php index 27bce9f..a36ad99 100644 --- a/src/CodeBuildClient.php +++ b/src/CodeBuildClient.php @@ -101,20 +101,21 @@ public function batchGetBuilds($input): BatchGetBuildsOutput * imagePullCredentialsTypeOverride?: null|ImagePullCredentialsType::*, * debugSessionEnabled?: null|bool, * fleetOverride?: null|ProjectFleet|array, + * autoRetryLimitOverride?: null|int, * '@region'?: string|null, * }|StartBuildInput $input * + * @throws AccountLimitExceededException * @throws InvalidInputException * @throws ResourceNotFoundException - * @throws AccountLimitExceededException */ public function startBuild($input): StartBuildOutput { $input = StartBuildInput::create($input); $response = $this->getResponse($input->request(), new RequestContext(['operation' => 'StartBuild', 'region' => $input->getRegion(), 'exceptionMapping' => [ + 'AccountLimitExceededException' => AccountLimitExceededException::class, 'InvalidInputException' => InvalidInputException::class, 'ResourceNotFoundException' => ResourceNotFoundException::class, - 'AccountLimitExceededException' => AccountLimitExceededException::class, ]])); return new StartBuildOutput($response); @@ -207,6 +208,29 @@ protected function getEndpointMetadata(?string $region): array 'signService' => 'codebuild', 'signVersions' => ['v4'], ]; + case 'us-iso-east-1': + case 'us-iso-west-1': + return [ + 'endpoint' => "https://codebuild.$region.c2s.ic.gov", + 'signRegion' => $region, + 'signService' => 'codebuild', + 'signVersions' => ['v4'], + ]; + case 'us-isof-east-1': + case 'us-isof-south-1': + return [ + 'endpoint' => "https://codebuild.$region.csp.hci.ic.gov", + 'signRegion' => $region, + 'signService' => 'codebuild', + 'signVersions' => ['v4'], + ]; + case 'us-isob-east-1': + return [ + 'endpoint' => 'https://codebuild.us-isob-east-1.sc2s.sgov.gov', + 'signRegion' => 'us-isob-east-1', + 'signService' => 'codebuild', + 'signVersions' => ['v4'], + ]; } return [ diff --git a/src/Enum/ComputeType.php b/src/Enum/ComputeType.php index dd81dc3..322ce20 100644 --- a/src/Enum/ComputeType.php +++ b/src/Enum/ComputeType.php @@ -4,6 +4,7 @@ final class ComputeType { + public const ATTRIBUTE_BASED_COMPUTE = 'ATTRIBUTE_BASED_COMPUTE'; public const BUILD_GENERAL1_2XLARGE = 'BUILD_GENERAL1_2XLARGE'; public const BUILD_GENERAL1_LARGE = 'BUILD_GENERAL1_LARGE'; public const BUILD_GENERAL1_MEDIUM = 'BUILD_GENERAL1_MEDIUM'; @@ -14,10 +15,12 @@ final class ComputeType public const BUILD_LAMBDA_2GB = 'BUILD_LAMBDA_2GB'; public const BUILD_LAMBDA_4GB = 'BUILD_LAMBDA_4GB'; public const BUILD_LAMBDA_8GB = 'BUILD_LAMBDA_8GB'; + public const CUSTOM_INSTANCE_TYPE = 'CUSTOM_INSTANCE_TYPE'; public static function exists(string $value): bool { return isset([ + self::ATTRIBUTE_BASED_COMPUTE => true, self::BUILD_GENERAL1_2XLARGE => true, self::BUILD_GENERAL1_LARGE => true, self::BUILD_GENERAL1_MEDIUM => true, @@ -28,6 +31,7 @@ public static function exists(string $value): bool self::BUILD_LAMBDA_2GB => true, self::BUILD_LAMBDA_4GB => true, self::BUILD_LAMBDA_8GB => true, + self::CUSTOM_INSTANCE_TYPE => true, ][$value]); } } diff --git a/src/Enum/EnvironmentType.php b/src/Enum/EnvironmentType.php index 137412a..f1145dd 100644 --- a/src/Enum/EnvironmentType.php +++ b/src/Enum/EnvironmentType.php @@ -5,25 +5,33 @@ final class EnvironmentType { public const ARM_CONTAINER = 'ARM_CONTAINER'; + public const ARM_EC2 = 'ARM_EC2'; public const ARM_LAMBDA_CONTAINER = 'ARM_LAMBDA_CONTAINER'; public const LINUX_CONTAINER = 'LINUX_CONTAINER'; + public const LINUX_EC2 = 'LINUX_EC2'; public const LINUX_GPU_CONTAINER = 'LINUX_GPU_CONTAINER'; public const LINUX_LAMBDA_CONTAINER = 'LINUX_LAMBDA_CONTAINER'; public const MAC_ARM = 'MAC_ARM'; public const WINDOWS_CONTAINER = 'WINDOWS_CONTAINER'; + public const WINDOWS_EC2 = 'WINDOWS_EC2'; public const WINDOWS_SERVER_2019_CONTAINER = 'WINDOWS_SERVER_2019_CONTAINER'; + public const WINDOWS_SERVER_2022_CONTAINER = 'WINDOWS_SERVER_2022_CONTAINER'; public static function exists(string $value): bool { return isset([ self::ARM_CONTAINER => true, + self::ARM_EC2 => true, self::ARM_LAMBDA_CONTAINER => true, self::LINUX_CONTAINER => true, + self::LINUX_EC2 => true, self::LINUX_GPU_CONTAINER => true, self::LINUX_LAMBDA_CONTAINER => true, self::MAC_ARM => true, self::WINDOWS_CONTAINER => true, + self::WINDOWS_EC2 => true, self::WINDOWS_SERVER_2019_CONTAINER => true, + self::WINDOWS_SERVER_2022_CONTAINER => true, ][$value]); } } diff --git a/src/Enum/MachineType.php b/src/Enum/MachineType.php new file mode 100644 index 0000000..a01ef61 --- /dev/null +++ b/src/Enum/MachineType.php @@ -0,0 +1,17 @@ + true, + self::NVME => true, + ][$value]); + } +} diff --git a/src/Input/StartBuildInput.php b/src/Input/StartBuildInput.php index 72877a9..db4b389 100644 --- a/src/Input/StartBuildInput.php +++ b/src/Input/StartBuildInput.php @@ -158,9 +158,11 @@ final class StartBuildInput extends Input * > 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. + * > bucket. Alternatively, you can restrict overrides to the buildspec by using a condition key: Prevent unauthorized + * > modifications to project buildspec [^2]. * * [^1]: https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html#build-spec-ref-name-storage + * [^2]: https://docs.aws.amazon.com/codebuild/latest/userguide/action-context-keys.html#action-context-keys-example-overridebuildspec.html * * @var string|null */ @@ -177,7 +179,8 @@ final class StartBuildInput extends Input /** * 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, or Bitbucket, an `invalidInputException` is thrown. + * with a source provider other than GitHub, GitHub Enterprise, GitLab, GitLab Self Managed, or Bitbucket, an + * `invalidInputException` is 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 @@ -335,6 +338,14 @@ final class StartBuildInput extends Input */ private $fleetOverride; + /** + * 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 `RetryBuild` API to automatically retry your build for up to 2 additional times. + * + * @var int|null + */ + private $autoRetryLimitOverride; + /** * @param array{ * projectName?: string, @@ -369,6 +380,7 @@ final class StartBuildInput extends Input * imagePullCredentialsTypeOverride?: null|ImagePullCredentialsType::*, * debugSessionEnabled?: null|bool, * fleetOverride?: null|ProjectFleet|array, + * autoRetryLimitOverride?: null|int, * '@region'?: string|null, * } $input */ @@ -406,6 +418,7 @@ public function __construct(array $input = []) $this->imagePullCredentialsTypeOverride = $input['imagePullCredentialsTypeOverride'] ?? null; $this->debugSessionEnabled = $input['debugSessionEnabled'] ?? null; $this->fleetOverride = isset($input['fleetOverride']) ? ProjectFleet::create($input['fleetOverride']) : null; + $this->autoRetryLimitOverride = $input['autoRetryLimitOverride'] ?? null; parent::__construct($input); } @@ -443,6 +456,7 @@ public function __construct(array $input = []) * imagePullCredentialsTypeOverride?: null|ImagePullCredentialsType::*, * debugSessionEnabled?: null|bool, * fleetOverride?: null|ProjectFleet|array, + * autoRetryLimitOverride?: null|int, * '@region'?: string|null, * }|StartBuildInput $input */ @@ -456,6 +470,11 @@ public function getArtifactsOverride(): ?ProjectArtifacts return $this->artifactsOverride; } + public function getAutoRetryLimitOverride(): ?int + { + return $this->autoRetryLimitOverride; + } + public function getBuildStatusConfigOverride(): ?BuildStatusConfig { return $this->buildStatusConfigOverride; @@ -668,6 +687,13 @@ public function setArtifactsOverride(?ProjectArtifacts $value): self return $this; } + public function setAutoRetryLimitOverride(?int $value): self + { + $this->autoRetryLimitOverride = $value; + + return $this; + } + public function setBuildStatusConfigOverride(?BuildStatusConfig $value): self { $this->buildStatusConfigOverride = $value; @@ -1041,6 +1067,9 @@ private function requestBody(): array if (null !== $v = $this->fleetOverride) { $payload['fleetOverride'] = $v->requestBody(); } + if (null !== $v = $this->autoRetryLimitOverride) { + $payload['autoRetryLimitOverride'] = $v; + } return $payload; } diff --git a/src/Result/BatchGetBuildsOutput.php b/src/Result/BatchGetBuildsOutput.php index d51c873..b0b8945 100644 --- a/src/Result/BatchGetBuildsOutput.php +++ b/src/Result/BatchGetBuildsOutput.php @@ -3,12 +3,16 @@ namespace AsyncAws\CodeBuild\Result; use AsyncAws\CodeBuild\Enum\CacheMode; +use AsyncAws\CodeBuild\ValueObject\AutoRetryConfig; use AsyncAws\CodeBuild\ValueObject\Build; use AsyncAws\CodeBuild\ValueObject\BuildArtifacts; use AsyncAws\CodeBuild\ValueObject\BuildPhase; use AsyncAws\CodeBuild\ValueObject\BuildStatusConfig; use AsyncAws\CodeBuild\ValueObject\CloudWatchLogsConfig; +use AsyncAws\CodeBuild\ValueObject\ComputeConfiguration; use AsyncAws\CodeBuild\ValueObject\DebugSession; +use AsyncAws\CodeBuild\ValueObject\DockerServer; +use AsyncAws\CodeBuild\ValueObject\DockerServerStatus; use AsyncAws\CodeBuild\ValueObject\EnvironmentVariable; use AsyncAws\CodeBuild\ValueObject\ExportedEnvironmentVariable; use AsyncAws\CodeBuild\ValueObject\GitSubmodulesConfig; @@ -72,6 +76,16 @@ protected function populateResult(Response $response): void $this->buildsNotFound = empty($data['buildsNotFound']) ? [] : $this->populateResultBuildIds($data['buildsNotFound']); } + private function populateResultAutoRetryConfig(array $json): AutoRetryConfig + { + return new AutoRetryConfig([ + 'autoRetryLimit' => isset($json['autoRetryLimit']) ? (int) $json['autoRetryLimit'] : null, + 'autoRetryNumber' => isset($json['autoRetryNumber']) ? (int) $json['autoRetryNumber'] : null, + 'nextAutoRetry' => isset($json['nextAutoRetry']) ? (string) $json['nextAutoRetry'] : null, + 'previousAutoRetry' => isset($json['previousAutoRetry']) ? (string) $json['previousAutoRetry'] : null, + ]); + } + private function populateResultBuild(array $json): Build { return new Build([ @@ -107,6 +121,7 @@ private function populateResultBuild(array $json): Build 'fileSystemLocations' => !isset($json['fileSystemLocations']) ? null : $this->populateResultProjectFileSystemLocations($json['fileSystemLocations']), 'debugSession' => empty($json['debugSession']) ? null : $this->populateResultDebugSession($json['debugSession']), 'buildBatchArn' => isset($json['buildBatchArn']) ? (string) $json['buildBatchArn'] : null, + 'autoRetryConfig' => empty($json['autoRetryConfig']) ? null : $this->populateResultAutoRetryConfig($json['autoRetryConfig']), ]); } @@ -223,6 +238,17 @@ private function populateResultCloudWatchLogsConfig(array $json): CloudWatchLogs ]); } + private function populateResultComputeConfiguration(array $json): ComputeConfiguration + { + return new ComputeConfiguration([ + 'vCpu' => isset($json['vCpu']) ? (int) $json['vCpu'] : null, + 'memory' => isset($json['memory']) ? (int) $json['memory'] : null, + 'disk' => isset($json['disk']) ? (int) $json['disk'] : null, + 'machineType' => isset($json['machineType']) ? (string) $json['machineType'] : null, + 'instanceType' => isset($json['instanceType']) ? (string) $json['instanceType'] : null, + ]); + } + private function populateResultDebugSession(array $json): DebugSession { return new DebugSession([ @@ -231,6 +257,23 @@ private function populateResultDebugSession(array $json): DebugSession ]); } + private function populateResultDockerServer(array $json): DockerServer + { + return new DockerServer([ + 'computeType' => (string) $json['computeType'], + 'securityGroupIds' => !isset($json['securityGroupIds']) ? null : $this->populateResultSecurityGroupIds($json['securityGroupIds']), + 'status' => empty($json['status']) ? null : $this->populateResultDockerServerStatus($json['status']), + ]); + } + + private function populateResultDockerServerStatus(array $json): DockerServerStatus + { + return new DockerServerStatus([ + 'status' => isset($json['status']) ? (string) $json['status'] : null, + 'message' => isset($json['message']) ? (string) $json['message'] : null, + ]); + } + private function populateResultEnvironmentVariable(array $json): EnvironmentVariable { return new EnvironmentVariable([ @@ -330,6 +373,7 @@ private function populateResultProjectCache(array $json): ProjectCache 'type' => (string) $json['type'], 'location' => isset($json['location']) ? (string) $json['location'] : null, 'modes' => !isset($json['modes']) ? null : $this->populateResultProjectCacheModes($json['modes']), + 'cacheNamespace' => isset($json['cacheNamespace']) ? (string) $json['cacheNamespace'] : null, ]); } @@ -355,12 +399,14 @@ private function populateResultProjectEnvironment(array $json): ProjectEnvironme 'type' => (string) $json['type'], 'image' => (string) $json['image'], 'computeType' => (string) $json['computeType'], + 'computeConfiguration' => empty($json['computeConfiguration']) ? null : $this->populateResultComputeConfiguration($json['computeConfiguration']), 'fleet' => empty($json['fleet']) ? null : $this->populateResultProjectFleet($json['fleet']), 'environmentVariables' => !isset($json['environmentVariables']) ? null : $this->populateResultEnvironmentVariables($json['environmentVariables']), 'privilegedMode' => isset($json['privilegedMode']) ? filter_var($json['privilegedMode'], \FILTER_VALIDATE_BOOLEAN) : null, 'certificate' => isset($json['certificate']) ? (string) $json['certificate'] : null, 'registryCredential' => empty($json['registryCredential']) ? null : $this->populateResultRegistryCredential($json['registryCredential']), 'imagePullCredentialsType' => isset($json['imagePullCredentialsType']) ? (string) $json['imagePullCredentialsType'] : null, + 'dockerServer' => empty($json['dockerServer']) ? null : $this->populateResultDockerServer($json['dockerServer']), ]); } diff --git a/src/Result/StartBuildOutput.php b/src/Result/StartBuildOutput.php index 9d69a77..c8cf505 100644 --- a/src/Result/StartBuildOutput.php +++ b/src/Result/StartBuildOutput.php @@ -3,12 +3,16 @@ namespace AsyncAws\CodeBuild\Result; use AsyncAws\CodeBuild\Enum\CacheMode; +use AsyncAws\CodeBuild\ValueObject\AutoRetryConfig; use AsyncAws\CodeBuild\ValueObject\Build; use AsyncAws\CodeBuild\ValueObject\BuildArtifacts; use AsyncAws\CodeBuild\ValueObject\BuildPhase; use AsyncAws\CodeBuild\ValueObject\BuildStatusConfig; use AsyncAws\CodeBuild\ValueObject\CloudWatchLogsConfig; +use AsyncAws\CodeBuild\ValueObject\ComputeConfiguration; use AsyncAws\CodeBuild\ValueObject\DebugSession; +use AsyncAws\CodeBuild\ValueObject\DockerServer; +use AsyncAws\CodeBuild\ValueObject\DockerServerStatus; use AsyncAws\CodeBuild\ValueObject\EnvironmentVariable; use AsyncAws\CodeBuild\ValueObject\ExportedEnvironmentVariable; use AsyncAws\CodeBuild\ValueObject\GitSubmodulesConfig; @@ -51,6 +55,16 @@ protected function populateResult(Response $response): void $this->build = empty($data['build']) ? null : $this->populateResultBuild($data['build']); } + private function populateResultAutoRetryConfig(array $json): AutoRetryConfig + { + return new AutoRetryConfig([ + 'autoRetryLimit' => isset($json['autoRetryLimit']) ? (int) $json['autoRetryLimit'] : null, + 'autoRetryNumber' => isset($json['autoRetryNumber']) ? (int) $json['autoRetryNumber'] : null, + 'nextAutoRetry' => isset($json['nextAutoRetry']) ? (string) $json['nextAutoRetry'] : null, + 'previousAutoRetry' => isset($json['previousAutoRetry']) ? (string) $json['previousAutoRetry'] : null, + ]); + } + private function populateResultBuild(array $json): Build { return new Build([ @@ -86,6 +100,7 @@ private function populateResultBuild(array $json): Build 'fileSystemLocations' => !isset($json['fileSystemLocations']) ? null : $this->populateResultProjectFileSystemLocations($json['fileSystemLocations']), 'debugSession' => empty($json['debugSession']) ? null : $this->populateResultDebugSession($json['debugSession']), 'buildBatchArn' => isset($json['buildBatchArn']) ? (string) $json['buildBatchArn'] : null, + 'autoRetryConfig' => empty($json['autoRetryConfig']) ? null : $this->populateResultAutoRetryConfig($json['autoRetryConfig']), ]); } @@ -173,6 +188,17 @@ private function populateResultCloudWatchLogsConfig(array $json): CloudWatchLogs ]); } + private function populateResultComputeConfiguration(array $json): ComputeConfiguration + { + return new ComputeConfiguration([ + 'vCpu' => isset($json['vCpu']) ? (int) $json['vCpu'] : null, + 'memory' => isset($json['memory']) ? (int) $json['memory'] : null, + 'disk' => isset($json['disk']) ? (int) $json['disk'] : null, + 'machineType' => isset($json['machineType']) ? (string) $json['machineType'] : null, + 'instanceType' => isset($json['instanceType']) ? (string) $json['instanceType'] : null, + ]); + } + private function populateResultDebugSession(array $json): DebugSession { return new DebugSession([ @@ -181,6 +207,23 @@ private function populateResultDebugSession(array $json): DebugSession ]); } + private function populateResultDockerServer(array $json): DockerServer + { + return new DockerServer([ + 'computeType' => (string) $json['computeType'], + 'securityGroupIds' => !isset($json['securityGroupIds']) ? null : $this->populateResultSecurityGroupIds($json['securityGroupIds']), + 'status' => empty($json['status']) ? null : $this->populateResultDockerServerStatus($json['status']), + ]); + } + + private function populateResultDockerServerStatus(array $json): DockerServerStatus + { + return new DockerServerStatus([ + 'status' => isset($json['status']) ? (string) $json['status'] : null, + 'message' => isset($json['message']) ? (string) $json['message'] : null, + ]); + } + private function populateResultEnvironmentVariable(array $json): EnvironmentVariable { return new EnvironmentVariable([ @@ -280,6 +323,7 @@ private function populateResultProjectCache(array $json): ProjectCache 'type' => (string) $json['type'], 'location' => isset($json['location']) ? (string) $json['location'] : null, 'modes' => !isset($json['modes']) ? null : $this->populateResultProjectCacheModes($json['modes']), + 'cacheNamespace' => isset($json['cacheNamespace']) ? (string) $json['cacheNamespace'] : null, ]); } @@ -305,12 +349,14 @@ private function populateResultProjectEnvironment(array $json): ProjectEnvironme 'type' => (string) $json['type'], 'image' => (string) $json['image'], 'computeType' => (string) $json['computeType'], + 'computeConfiguration' => empty($json['computeConfiguration']) ? null : $this->populateResultComputeConfiguration($json['computeConfiguration']), 'fleet' => empty($json['fleet']) ? null : $this->populateResultProjectFleet($json['fleet']), 'environmentVariables' => !isset($json['environmentVariables']) ? null : $this->populateResultEnvironmentVariables($json['environmentVariables']), 'privilegedMode' => isset($json['privilegedMode']) ? filter_var($json['privilegedMode'], \FILTER_VALIDATE_BOOLEAN) : null, 'certificate' => isset($json['certificate']) ? (string) $json['certificate'] : null, 'registryCredential' => empty($json['registryCredential']) ? null : $this->populateResultRegistryCredential($json['registryCredential']), 'imagePullCredentialsType' => isset($json['imagePullCredentialsType']) ? (string) $json['imagePullCredentialsType'] : null, + 'dockerServer' => empty($json['dockerServer']) ? null : $this->populateResultDockerServer($json['dockerServer']), ]); } diff --git a/src/Result/StopBuildOutput.php b/src/Result/StopBuildOutput.php index 4ce4531..4630884 100644 --- a/src/Result/StopBuildOutput.php +++ b/src/Result/StopBuildOutput.php @@ -3,12 +3,16 @@ namespace AsyncAws\CodeBuild\Result; use AsyncAws\CodeBuild\Enum\CacheMode; +use AsyncAws\CodeBuild\ValueObject\AutoRetryConfig; use AsyncAws\CodeBuild\ValueObject\Build; use AsyncAws\CodeBuild\ValueObject\BuildArtifacts; use AsyncAws\CodeBuild\ValueObject\BuildPhase; use AsyncAws\CodeBuild\ValueObject\BuildStatusConfig; use AsyncAws\CodeBuild\ValueObject\CloudWatchLogsConfig; +use AsyncAws\CodeBuild\ValueObject\ComputeConfiguration; use AsyncAws\CodeBuild\ValueObject\DebugSession; +use AsyncAws\CodeBuild\ValueObject\DockerServer; +use AsyncAws\CodeBuild\ValueObject\DockerServerStatus; use AsyncAws\CodeBuild\ValueObject\EnvironmentVariable; use AsyncAws\CodeBuild\ValueObject\ExportedEnvironmentVariable; use AsyncAws\CodeBuild\ValueObject\GitSubmodulesConfig; @@ -51,6 +55,16 @@ protected function populateResult(Response $response): void $this->build = empty($data['build']) ? null : $this->populateResultBuild($data['build']); } + private function populateResultAutoRetryConfig(array $json): AutoRetryConfig + { + return new AutoRetryConfig([ + 'autoRetryLimit' => isset($json['autoRetryLimit']) ? (int) $json['autoRetryLimit'] : null, + 'autoRetryNumber' => isset($json['autoRetryNumber']) ? (int) $json['autoRetryNumber'] : null, + 'nextAutoRetry' => isset($json['nextAutoRetry']) ? (string) $json['nextAutoRetry'] : null, + 'previousAutoRetry' => isset($json['previousAutoRetry']) ? (string) $json['previousAutoRetry'] : null, + ]); + } + private function populateResultBuild(array $json): Build { return new Build([ @@ -86,6 +100,7 @@ private function populateResultBuild(array $json): Build 'fileSystemLocations' => !isset($json['fileSystemLocations']) ? null : $this->populateResultProjectFileSystemLocations($json['fileSystemLocations']), 'debugSession' => empty($json['debugSession']) ? null : $this->populateResultDebugSession($json['debugSession']), 'buildBatchArn' => isset($json['buildBatchArn']) ? (string) $json['buildBatchArn'] : null, + 'autoRetryConfig' => empty($json['autoRetryConfig']) ? null : $this->populateResultAutoRetryConfig($json['autoRetryConfig']), ]); } @@ -173,6 +188,17 @@ private function populateResultCloudWatchLogsConfig(array $json): CloudWatchLogs ]); } + private function populateResultComputeConfiguration(array $json): ComputeConfiguration + { + return new ComputeConfiguration([ + 'vCpu' => isset($json['vCpu']) ? (int) $json['vCpu'] : null, + 'memory' => isset($json['memory']) ? (int) $json['memory'] : null, + 'disk' => isset($json['disk']) ? (int) $json['disk'] : null, + 'machineType' => isset($json['machineType']) ? (string) $json['machineType'] : null, + 'instanceType' => isset($json['instanceType']) ? (string) $json['instanceType'] : null, + ]); + } + private function populateResultDebugSession(array $json): DebugSession { return new DebugSession([ @@ -181,6 +207,23 @@ private function populateResultDebugSession(array $json): DebugSession ]); } + private function populateResultDockerServer(array $json): DockerServer + { + return new DockerServer([ + 'computeType' => (string) $json['computeType'], + 'securityGroupIds' => !isset($json['securityGroupIds']) ? null : $this->populateResultSecurityGroupIds($json['securityGroupIds']), + 'status' => empty($json['status']) ? null : $this->populateResultDockerServerStatus($json['status']), + ]); + } + + private function populateResultDockerServerStatus(array $json): DockerServerStatus + { + return new DockerServerStatus([ + 'status' => isset($json['status']) ? (string) $json['status'] : null, + 'message' => isset($json['message']) ? (string) $json['message'] : null, + ]); + } + private function populateResultEnvironmentVariable(array $json): EnvironmentVariable { return new EnvironmentVariable([ @@ -280,6 +323,7 @@ private function populateResultProjectCache(array $json): ProjectCache 'type' => (string) $json['type'], 'location' => isset($json['location']) ? (string) $json['location'] : null, 'modes' => !isset($json['modes']) ? null : $this->populateResultProjectCacheModes($json['modes']), + 'cacheNamespace' => isset($json['cacheNamespace']) ? (string) $json['cacheNamespace'] : null, ]); } @@ -305,12 +349,14 @@ private function populateResultProjectEnvironment(array $json): ProjectEnvironme 'type' => (string) $json['type'], 'image' => (string) $json['image'], 'computeType' => (string) $json['computeType'], + 'computeConfiguration' => empty($json['computeConfiguration']) ? null : $this->populateResultComputeConfiguration($json['computeConfiguration']), 'fleet' => empty($json['fleet']) ? null : $this->populateResultProjectFleet($json['fleet']), 'environmentVariables' => !isset($json['environmentVariables']) ? null : $this->populateResultEnvironmentVariables($json['environmentVariables']), 'privilegedMode' => isset($json['privilegedMode']) ? filter_var($json['privilegedMode'], \FILTER_VALIDATE_BOOLEAN) : null, 'certificate' => isset($json['certificate']) ? (string) $json['certificate'] : null, 'registryCredential' => empty($json['registryCredential']) ? null : $this->populateResultRegistryCredential($json['registryCredential']), 'imagePullCredentialsType' => isset($json['imagePullCredentialsType']) ? (string) $json['imagePullCredentialsType'] : null, + 'dockerServer' => empty($json['dockerServer']) ? null : $this->populateResultDockerServer($json['dockerServer']), ]); } diff --git a/src/ValueObject/AutoRetryConfig.php b/src/ValueObject/AutoRetryConfig.php new file mode 100644 index 0000000..060a640 --- /dev/null +++ b/src/ValueObject/AutoRetryConfig.php @@ -0,0 +1,89 @@ +autoRetryLimit = $input['autoRetryLimit'] ?? null; + $this->autoRetryNumber = $input['autoRetryNumber'] ?? null; + $this->nextAutoRetry = $input['nextAutoRetry'] ?? null; + $this->previousAutoRetry = $input['previousAutoRetry'] ?? null; + } + + /** + * @param array{ + * autoRetryLimit?: null|int, + * autoRetryNumber?: null|int, + * nextAutoRetry?: null|string, + * previousAutoRetry?: null|string, + * }|AutoRetryConfig $input + */ + public static function create($input): self + { + return $input instanceof self ? $input : new self($input); + } + + public function getAutoRetryLimit(): ?int + { + return $this->autoRetryLimit; + } + + public function getAutoRetryNumber(): ?int + { + return $this->autoRetryNumber; + } + + public function getNextAutoRetry(): ?string + { + return $this->nextAutoRetry; + } + + public function getPreviousAutoRetry(): ?string + { + return $this->previousAutoRetry; + } +} diff --git a/src/ValueObject/Build.php b/src/ValueObject/Build.php index a3aadb4..3a1150b 100644 --- a/src/ValueObject/Build.php +++ b/src/ValueObject/Build.php @@ -282,6 +282,13 @@ final class Build */ private $buildBatchArn; + /** + * Information about the auto-retry configuration for the build. + * + * @var AutoRetryConfig|null + */ + private $autoRetryConfig; + /** * @param array{ * id?: null|string, @@ -316,6 +323,7 @@ final class Build * fileSystemLocations?: null|array, * debugSession?: null|DebugSession|array, * buildBatchArn?: null|string, + * autoRetryConfig?: null|AutoRetryConfig|array, * } $input */ public function __construct(array $input) @@ -352,6 +360,7 @@ public function __construct(array $input) $this->fileSystemLocations = isset($input['fileSystemLocations']) ? array_map([ProjectFileSystemLocation::class, 'create'], $input['fileSystemLocations']) : null; $this->debugSession = isset($input['debugSession']) ? DebugSession::create($input['debugSession']) : null; $this->buildBatchArn = $input['buildBatchArn'] ?? null; + $this->autoRetryConfig = isset($input['autoRetryConfig']) ? AutoRetryConfig::create($input['autoRetryConfig']) : null; } /** @@ -388,6 +397,7 @@ public function __construct(array $input) * fileSystemLocations?: null|array, * debugSession?: null|DebugSession|array, * buildBatchArn?: null|string, + * autoRetryConfig?: null|AutoRetryConfig|array, * }|Build $input */ public static function create($input): self @@ -405,6 +415,11 @@ public function getArtifacts(): ?BuildArtifacts return $this->artifacts; } + public function getAutoRetryConfig(): ?AutoRetryConfig + { + return $this->autoRetryConfig; + } + public function getBuildBatchArn(): ?string { return $this->buildBatchArn; diff --git a/src/ValueObject/ComputeConfiguration.php b/src/ValueObject/ComputeConfiguration.php new file mode 100644 index 0000000..44ae546 --- /dev/null +++ b/src/ValueObject/ComputeConfiguration.php @@ -0,0 +1,107 @@ +vCpu = $input['vCpu'] ?? null; + $this->memory = $input['memory'] ?? null; + $this->disk = $input['disk'] ?? null; + $this->machineType = $input['machineType'] ?? null; + $this->instanceType = $input['instanceType'] ?? null; + } + + /** + * @param array{ + * vCpu?: null|int, + * memory?: null|int, + * disk?: null|int, + * machineType?: null|MachineType::*, + * instanceType?: null|string, + * }|ComputeConfiguration $input + */ + public static function create($input): self + { + return $input instanceof self ? $input : new self($input); + } + + public function getDisk(): ?int + { + return $this->disk; + } + + public function getInstanceType(): ?string + { + return $this->instanceType; + } + + /** + * @return MachineType::*|null + */ + public function getMachineType(): ?string + { + return $this->machineType; + } + + public function getMemory(): ?int + { + return $this->memory; + } + + public function getVCpu(): ?int + { + return $this->vCpu; + } +} diff --git a/src/ValueObject/DockerServer.php b/src/ValueObject/DockerServer.php new file mode 100644 index 0000000..a6830a0 --- /dev/null +++ b/src/ValueObject/DockerServer.php @@ -0,0 +1,97 @@ + Security groups configured for Docker servers should allow ingress network traffic from the VPC configured in the + * > project. They should allow ingress on port 9876. + * + * @var string[]|null + */ + private $securityGroupIds; + + /** + * A DockerServerStatus object to use for this docker server. + * + * @var DockerServerStatus|null + */ + private $status; + + /** + * @param array{ + * computeType: ComputeType::*, + * securityGroupIds?: null|string[], + * status?: null|DockerServerStatus|array, + * } $input + */ + public function __construct(array $input) + { + $this->computeType = $input['computeType'] ?? $this->throwException(new InvalidArgument('Missing required field "computeType".')); + $this->securityGroupIds = $input['securityGroupIds'] ?? null; + $this->status = isset($input['status']) ? DockerServerStatus::create($input['status']) : null; + } + + /** + * @param array{ + * computeType: ComputeType::*, + * securityGroupIds?: null|string[], + * status?: null|DockerServerStatus|array, + * }|DockerServer $input + */ + public static function create($input): self + { + return $input instanceof self ? $input : new self($input); + } + + /** + * @return ComputeType::* + */ + public function getComputeType(): string + { + return $this->computeType; + } + + /** + * @return string[] + */ + public function getSecurityGroupIds(): array + { + return $this->securityGroupIds ?? []; + } + + public function getStatus(): ?DockerServerStatus + { + return $this->status; + } + + /** + * @return never + */ + private function throwException(\Throwable $exception) + { + throw $exception; + } +} diff --git a/src/ValueObject/DockerServerStatus.php b/src/ValueObject/DockerServerStatus.php new file mode 100644 index 0000000..32590fc --- /dev/null +++ b/src/ValueObject/DockerServerStatus.php @@ -0,0 +1,56 @@ +status = $input['status'] ?? null; + $this->message = $input['message'] ?? null; + } + + /** + * @param array{ + * status?: null|string, + * message?: null|string, + * }|DockerServerStatus $input + */ + public static function create($input): self + { + return $input instanceof self ? $input : new self($input); + } + + public function getMessage(): ?string + { + return $this->message; + } + + public function getStatus(): ?string + { + return $this->status; + } +} diff --git a/src/ValueObject/ProjectCache.php b/src/ValueObject/ProjectCache.php index bfd29f4..ca64325 100644 --- a/src/ValueObject/ProjectCache.php +++ b/src/ValueObject/ProjectCache.php @@ -68,11 +68,22 @@ final class ProjectCache */ private $modes; + /** + * Defines the scope of the cache. You can use this namespace to share a cache across multiple projects. For more + * information, see Cache sharing between projects [^1] in the *CodeBuild User Guide*. + * + * [^1]: https://docs.aws.amazon.com/codebuild/latest/userguide/caching-s3.html#caching-s3-sharing + * + * @var string|null + */ + private $cacheNamespace; + /** * @param array{ * type: CacheType::*, * location?: null|string, * modes?: null|array, + * cacheNamespace?: null|string, * } $input */ public function __construct(array $input) @@ -80,6 +91,7 @@ public function __construct(array $input) $this->type = $input['type'] ?? $this->throwException(new InvalidArgument('Missing required field "type".')); $this->location = $input['location'] ?? null; $this->modes = $input['modes'] ?? null; + $this->cacheNamespace = $input['cacheNamespace'] ?? null; } /** @@ -87,6 +99,7 @@ public function __construct(array $input) * type: CacheType::*, * location?: null|string, * modes?: null|array, + * cacheNamespace?: null|string, * }|ProjectCache $input */ public static function create($input): self @@ -94,6 +107,11 @@ public static function create($input): self return $input instanceof self ? $input : new self($input); } + public function getCacheNamespace(): ?string + { + return $this->cacheNamespace; + } + public function getLocation(): ?string { return $this->location; @@ -140,6 +158,9 @@ public function requestBody(): array $payload['modes'][$index] = $listValue; } } + if (null !== $v = $this->cacheNamespace) { + $payload['cacheNamespace'] = $v; + } return $payload; } diff --git a/src/ValueObject/ProjectEnvironment.php b/src/ValueObject/ProjectEnvironment.php index 9ae5f8a..4f64be6 100644 --- a/src/ValueObject/ProjectEnvironment.php +++ b/src/ValueObject/ProjectEnvironment.php @@ -15,22 +15,6 @@ final class ProjectEnvironment /** * The type of build environment to use for related builds. * - * - The environment type `ARM_CONTAINER` is available only in regions US East (N. Virginia), US East (Ohio), US West - * (Oregon), EU (Ireland), Asia Pacific (Mumbai), Asia Pacific (Tokyo), Asia Pacific (Sydney), and EU (Frankfurt). - * - The environment type `LINUX_CONTAINER` is available only in regions US East (N. Virginia), US East (Ohio), US West - * (Oregon), Canada (Central), EU (Ireland), EU (London), EU (Frankfurt), Asia Pacific (Tokyo), Asia Pacific (Seoul), - * Asia Pacific (Singapore), Asia Pacific (Sydney), China (Beijing), and China (Ningxia). - * - The environment type `LINUX_GPU_CONTAINER` is available only in regions US East (N. Virginia), US East (Ohio), US - * West (Oregon), Canada (Central), EU (Ireland), EU (London), EU (Frankfurt), Asia Pacific (Tokyo), Asia Pacific - * (Seoul), Asia Pacific (Singapore), Asia Pacific (Sydney) , China (Beijing), and China (Ningxia). - * - * - The environment types `ARM_LAMBDA_CONTAINER` and `LINUX_LAMBDA_CONTAINER` are available only in regions US East (N. - * Virginia), US East (Ohio), US West (Oregon), Asia Pacific (Mumbai), Asia Pacific (Singapore), Asia Pacific - * (Sydney), Asia Pacific (Tokyo), EU (Frankfurt), EU (Ireland), and South America (São Paulo). - * - * - The environment types `WINDOWS_CONTAINER` and `WINDOWS_SERVER_2019_CONTAINER` are available only in regions US East - * (N. Virginia), US East (Ohio), US West (Oregon), and EU (Ireland). - * * > If you're using compute fleets during project creation, `type` will be ignored. * * For more information, see Build environment compute types [^1] in the *CodeBuild user guide*. @@ -62,48 +46,62 @@ final class ProjectEnvironment /** * Information about the compute resources the build project uses. Available values include: * - * - `BUILD_GENERAL1_SMALL`: Use up to 3 GB memory and 2 vCPUs for builds. - * - `BUILD_GENERAL1_MEDIUM`: Use up to 7 GB memory and 4 vCPUs for builds. - * - `BUILD_GENERAL1_LARGE`: Use up to 16 GB memory and 8 vCPUs for builds, depending on your environment type. - * - `BUILD_GENERAL1_XLARGE`: Use up to 70 GB memory and 36 vCPUs for builds, depending on your environment type. - * - `BUILD_GENERAL1_2XLARGE`: Use up to 145 GB memory, 72 vCPUs, and 824 GB of SSD storage for builds. This compute + * - `ATTRIBUTE_BASED_COMPUTE`: Specify the amount of vCPUs, memory, disk space, and the type of machine. + * + * > If you use `ATTRIBUTE_BASED_COMPUTE`, you must define your attributes by using `computeConfiguration`. CodeBuild + * > will select the cheapest instance that satisfies your specified attributes. For more information, see Reserved + * > capacity environment types [^1] in the *CodeBuild User Guide*. + * + * - `BUILD_GENERAL1_SMALL`: Use up to 4 GiB memory and 2 vCPUs for builds. + * - `BUILD_GENERAL1_MEDIUM`: Use up to 8 GiB memory and 4 vCPUs for builds. + * - `BUILD_GENERAL1_LARGE`: Use up to 16 GiB memory and 8 vCPUs for builds, depending on your environment type. + * - `BUILD_GENERAL1_XLARGE`: Use up to 72 GiB memory and 36 vCPUs for builds, depending on your environment type. + * - `BUILD_GENERAL1_2XLARGE`: Use up to 144 GiB memory, 72 vCPUs, and 824 GB of SSD storage for builds. This compute * type supports Docker images up to 100 GB uncompressed. - * - `BUILD_LAMBDA_1GB`: Use up to 1 GB memory for builds. Only available for environment type `LINUX_LAMBDA_CONTAINER` + * - `BUILD_LAMBDA_1GB`: Use up to 1 GiB memory for builds. Only available for environment type `LINUX_LAMBDA_CONTAINER` * and `ARM_LAMBDA_CONTAINER`. - * - `BUILD_LAMBDA_2GB`: Use up to 2 GB memory for builds. Only available for environment type `LINUX_LAMBDA_CONTAINER` + * - `BUILD_LAMBDA_2GB`: Use up to 2 GiB memory for builds. Only available for environment type `LINUX_LAMBDA_CONTAINER` * and `ARM_LAMBDA_CONTAINER`. - * - `BUILD_LAMBDA_4GB`: Use up to 4 GB memory for builds. Only available for environment type `LINUX_LAMBDA_CONTAINER` + * - `BUILD_LAMBDA_4GB`: Use up to 4 GiB memory for builds. Only available for environment type `LINUX_LAMBDA_CONTAINER` * and `ARM_LAMBDA_CONTAINER`. - * - `BUILD_LAMBDA_8GB`: Use up to 8 GB memory for builds. Only available for environment type `LINUX_LAMBDA_CONTAINER` + * - `BUILD_LAMBDA_8GB`: Use up to 8 GiB memory for builds. Only available for environment type `LINUX_LAMBDA_CONTAINER` * and `ARM_LAMBDA_CONTAINER`. - * - `BUILD_LAMBDA_10GB`: Use up to 10 GB memory for builds. Only available for environment type + * - `BUILD_LAMBDA_10GB`: Use up to 10 GiB memory for builds. Only available for environment type * `LINUX_LAMBDA_CONTAINER` and `ARM_LAMBDA_CONTAINER`. * * If you use `BUILD_GENERAL1_SMALL`: * - * - For environment type `LINUX_CONTAINER`, you can use up to 3 GB memory and 2 vCPUs for builds. - * - For environment type `LINUX_GPU_CONTAINER`, you can use up to 16 GB memory, 4 vCPUs, and 1 NVIDIA A10G Tensor Core + * - For environment type `LINUX_CONTAINER`, you can use up to 4 GiB memory and 2 vCPUs for builds. + * - For environment type `LINUX_GPU_CONTAINER`, you can use up to 16 GiB memory, 4 vCPUs, and 1 NVIDIA A10G Tensor Core * GPU for builds. - * - For environment type `ARM_CONTAINER`, you can use up to 4 GB memory and 2 vCPUs on ARM-based processors for builds. + * - For environment type `ARM_CONTAINER`, you can use up to 4 GiB memory and 2 vCPUs on ARM-based processors for + * builds. * * If you use `BUILD_GENERAL1_LARGE`: * - * - For environment type `LINUX_CONTAINER`, you can use up to 15 GB memory and 8 vCPUs for builds. - * - For environment type `LINUX_GPU_CONTAINER`, you can use up to 255 GB memory, 32 vCPUs, and 4 NVIDIA Tesla V100 GPUs - * for builds. - * - For environment type `ARM_CONTAINER`, you can use up to 16 GB memory and 8 vCPUs on ARM-based processors for + * - For environment type `LINUX_CONTAINER`, you can use up to 16 GiB memory and 8 vCPUs for builds. + * - For environment type `LINUX_GPU_CONTAINER`, you can use up to 255 GiB memory, 32 vCPUs, and 4 NVIDIA Tesla V100 + * GPUs for builds. + * - For environment type `ARM_CONTAINER`, you can use up to 16 GiB memory and 8 vCPUs on ARM-based processors for * builds. * - * > If you're using compute fleets during project creation, `computeType` will be ignored. - * - * For more information, see Build Environment Compute Types [^1] in the *CodeBuild User Guide.* + * For more information, see On-demand environment types [^2] in the *CodeBuild User Guide.* * - * [^1]: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html + * [^1]: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html#environment-reserved-capacity.types + * [^2]: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html#environment.types * * @var ComputeType::* */ private $computeType; + /** + * The compute configuration of the build project. This is only required if `computeType` is set to + * `ATTRIBUTE_BASED_COMPUTE`. + * + * @var ComputeConfiguration|null + */ + private $computeConfiguration; + /** * A ProjectFleet object to use for this build project. * @@ -176,17 +174,26 @@ final class ProjectEnvironment */ private $imagePullCredentialsType; + /** + * A DockerServer object to use for this build project. + * + * @var DockerServer|null + */ + private $dockerServer; + /** * @param array{ * type: EnvironmentType::*, * image: string, * computeType: ComputeType::*, + * computeConfiguration?: null|ComputeConfiguration|array, * fleet?: null|ProjectFleet|array, * environmentVariables?: null|array, * privilegedMode?: null|bool, * certificate?: null|string, * registryCredential?: null|RegistryCredential|array, * imagePullCredentialsType?: null|ImagePullCredentialsType::*, + * dockerServer?: null|DockerServer|array, * } $input */ public function __construct(array $input) @@ -194,12 +201,14 @@ public function __construct(array $input) $this->type = $input['type'] ?? $this->throwException(new InvalidArgument('Missing required field "type".')); $this->image = $input['image'] ?? $this->throwException(new InvalidArgument('Missing required field "image".')); $this->computeType = $input['computeType'] ?? $this->throwException(new InvalidArgument('Missing required field "computeType".')); + $this->computeConfiguration = isset($input['computeConfiguration']) ? ComputeConfiguration::create($input['computeConfiguration']) : null; $this->fleet = isset($input['fleet']) ? ProjectFleet::create($input['fleet']) : null; $this->environmentVariables = isset($input['environmentVariables']) ? array_map([EnvironmentVariable::class, 'create'], $input['environmentVariables']) : null; $this->privilegedMode = $input['privilegedMode'] ?? null; $this->certificate = $input['certificate'] ?? null; $this->registryCredential = isset($input['registryCredential']) ? RegistryCredential::create($input['registryCredential']) : null; $this->imagePullCredentialsType = $input['imagePullCredentialsType'] ?? null; + $this->dockerServer = isset($input['dockerServer']) ? DockerServer::create($input['dockerServer']) : null; } /** @@ -207,12 +216,14 @@ public function __construct(array $input) * type: EnvironmentType::*, * image: string, * computeType: ComputeType::*, + * computeConfiguration?: null|ComputeConfiguration|array, * fleet?: null|ProjectFleet|array, * environmentVariables?: null|array, * privilegedMode?: null|bool, * certificate?: null|string, * registryCredential?: null|RegistryCredential|array, * imagePullCredentialsType?: null|ImagePullCredentialsType::*, + * dockerServer?: null|DockerServer|array, * }|ProjectEnvironment $input */ public static function create($input): self @@ -225,6 +236,11 @@ public function getCertificate(): ?string return $this->certificate; } + public function getComputeConfiguration(): ?ComputeConfiguration + { + return $this->computeConfiguration; + } + /** * @return ComputeType::* */ @@ -233,6 +249,11 @@ public function getComputeType(): string return $this->computeType; } + public function getDockerServer(): ?DockerServer + { + return $this->dockerServer; + } + /** * @return EnvironmentVariable[] */ diff --git a/src/ValueObject/ProjectSource.php b/src/ValueObject/ProjectSource.php index fd10871..0be67d1 100644 --- a/src/ValueObject/ProjectSource.php +++ b/src/ValueObject/ProjectSource.php @@ -111,8 +111,8 @@ final class ProjectSource /** * Set to true to report the status of a build's start and finish to your source provider. This option is valid only - * when your source provider is GitHub, GitHub Enterprise, GitLab, GitLab Self Managed, or Bitbucket. If this is set and - * you use a different source provider, an `invalidInputException` is thrown. + * when your source provider is GitHub, GitHub Enterprise, GitLab, GitLab Self Managed, GitLab, GitLab Self Managed, or + * Bitbucket. If this is set and you use a different source provider, an `invalidInputException` is 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