diff --git a/CHANGELOG.md b/CHANGELOG.md index d1cd790..d0133f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## NOT RELEASED +### Added + +- AWS api-change: Supporting GitLab and GitLab Self Managed as source types in AWS CodeBuild. + ### Changed - AWS enhancement: Documentation updates. diff --git a/composer.json b/composer.json index b6204bb..3a983c8 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ }, "extra": { "branch-alias": { - "dev-master": "2.3-dev" + "dev-master": "2.4-dev" } } } diff --git a/src/Enum/SourceAuthType.php b/src/Enum/SourceAuthType.php index f0d9e84..85dda36 100644 --- a/src/Enum/SourceAuthType.php +++ b/src/Enum/SourceAuthType.php @@ -4,11 +4,13 @@ final class SourceAuthType { + public const CODECONNECTIONS = 'CODECONNECTIONS'; public const OAUTH = 'OAUTH'; public static function exists(string $value): bool { return isset([ + self::CODECONNECTIONS => true, self::OAUTH => true, ][$value]); } diff --git a/src/Enum/SourceType.php b/src/Enum/SourceType.php index 178c64f..be95e08 100644 --- a/src/Enum/SourceType.php +++ b/src/Enum/SourceType.php @@ -9,6 +9,8 @@ final class SourceType public const CODEPIPELINE = 'CODEPIPELINE'; public const GITHUB = 'GITHUB'; public const GITHUB_ENTERPRISE = 'GITHUB_ENTERPRISE'; + public const GITLAB = 'GITLAB'; + public const GITLAB_SELF_MANAGED = 'GITLAB_SELF_MANAGED'; public const NO_SOURCE = 'NO_SOURCE'; public const S3 = 'S3'; @@ -20,6 +22,8 @@ public static function exists(string $value): bool self::CODEPIPELINE => true, self::GITHUB => true, self::GITHUB_ENTERPRISE => true, + self::GITLAB => true, + self::GITLAB_SELF_MANAGED => true, self::NO_SOURCE => true, self::S3 => true, ][$value]); diff --git a/src/ValueObject/ProjectSource.php b/src/ValueObject/ProjectSource.php index 3cef64e..99b3ef3 100644 --- a/src/ValueObject/ProjectSource.php +++ b/src/ValueObject/ProjectSource.php @@ -16,8 +16,10 @@ final class ProjectSource * - `BITBUCKET`: The source code is in a Bitbucket repository. * - `CODECOMMIT`: The source code is in an CodeCommit repository. * - `CODEPIPELINE`: The source code settings are specified in the source action of a pipeline in CodePipeline. - * - `GITHUB`: The source code is in a GitHub or GitHub Enterprise Cloud repository. + * - `GITHUB`: The source code is in a GitHub repository. * - `GITHUB_ENTERPRISE`: The source code is in a GitHub Enterprise Server repository. + * - `GITLAB`: The source code is in a GitLab repository. + * - `GITLAB_SELF_MANAGED`: The source code is in a self-managed GitLab repository. * - `NO_SOURCE`: The project does not have input source code. * - `S3`: The source code is in an Amazon S3 bucket. * @@ -48,6 +50,14 @@ final class ProjectSource * want to allow CodeBuild to have access to, and then choose **Authorize application**. (After you have connected to * your GitHub account, you do not need to finish creating the build project. You can leave the CodeBuild console.) To * instruct CodeBuild to use this connection, in the `source` object, set the `auth` object's `type` value to `OAUTH`. + * - For source code in an GitLab or self-managed GitLab repository, the HTTPS clone URL to the repository that contains + * the source and the buildspec file. You must connect your Amazon Web Services account to your GitLab account. Use + * the CodeBuild console to start creating a build project. When you use the console to connect (or reconnect) with + * GitLab, on the Connections **Authorize application** page, choose **Authorize**. Then on the CodeStar Connections + * **Create GitLab connection** page, choose **Connect to GitLab**. (After you have connected to your GitLab account, + * you do not need to finish creating the build project. You can leave the CodeBuild console.) To instruct CodeBuild + * to override the default connection and use this connection instead, set the `auth` object's `type` value to + * `CODECONNECTIONS` in the `source` object. * - For source code in a Bitbucket repository, the HTTPS clone URL to the repository that contains the source and the * buildspec file. You must connect your Amazon Web Services account to your Bitbucket account. Use the CodeBuild * console to start creating a build project. When you use the console to connect (or reconnect) with Bitbucket, on @@ -103,8 +113,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, 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, 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 diff --git a/src/ValueObject/ProjectSourceVersion.php b/src/ValueObject/ProjectSourceVersion.php index 748b211..62ffe83 100644 --- a/src/ValueObject/ProjectSourceVersion.php +++ b/src/ValueObject/ProjectSourceVersion.php @@ -21,9 +21,9 @@ final class ProjectSourceVersion * The source version for the corresponding source identifier. If specified, 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 + * - For GitHub or GitLab: 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 diff --git a/src/ValueObject/SourceAuth.php b/src/ValueObject/SourceAuth.php index 0eb48a3..b60036f 100644 --- a/src/ValueObject/SourceAuth.php +++ b/src/ValueObject/SourceAuth.php @@ -13,9 +13,7 @@ final class SourceAuth { /** - * > This data type is deprecated and is no longer accurate or used. - * - * The authorization type to use. The only valid value is `OAUTH`, which represents the OAuth authorization type. + * The authorization type to use. Valid options are OAUTH or CODECONNECTIONS. * * @var SourceAuthType::* */