是否可以结合 AWS CodeBuild 和 CodePipeline 来构建描述的 CI 工作流程?
Is it possible to combine AWS CodeBuild and CodePipeline to build described CI workflow?
我想做的是使用标准 AWS 工具创建以下 CI 流程:运行 在 Github 中创建合并请求时构建提交或更新。或者 运行 根据我的命令构建任何分支。与 Codeship、Travis 和许多其他 CI 服务提供的非常相似。
CodeBuild + CodePipeline 可以吗?我注意到我必须在 CodePipeline 中指定确切的分支,不幸的是,找不到如何将 Github 拉取请求集成到其中。也许我忽略了它?
看起来这可以通过使用 Lambda 和 S3 手动完成 - https://aws.amazon.com/blogs/devops/integrating-git-with-aws-codepipeline/
Webhooks notify a remote service by issuing an HTTP POST when a commit is pushed to the repository. AWS Lambda receives the HTTP POST through Amazon API Gateway, and then downloads a copy of the repository. It places a zipped copy of the repository into a versioned S3 bucket. AWS CodePipeline can then use the zip file in S3 as a source; the pipeline will be triggered whenever the Git repository is updated.
CodePipeline 确实支持与 GitHub 和 CodeBuild 的基本、完全托管的集成,如 Product and Service Integrations with AWS CodePipeline. With these integrations, it is possible to use CodeBuild with CodePipeline to run a build of a commit when a commit is pushed to a branch on GitHub. See Use AWS CodePipeline with AWS CodeBuild to Run Builds for details on integrating CodeBuild with CodePipeline as a Build
action provider, and see the Four-Stage Pipeline Tutorial 中所列,有关将 Github 与 CodePipeline 作为 Source
集成的详细信息动作提供者。
目前Github中的Pull Request功能在官方CodePipeline集成中不支持,你没有忽略任何东西。对于一个有趣的 AWS 生态系统开源项目(还不是 v1.0),它确实支持 GitHub Pull Request 集成(尽管 not yet CodePipeline), you might want to check out LambCI.
您可以尝试 https://www.deploytoproduction.com Github 拉取请求构建状态与 AWS CodeBuild 的集成。单个 Github 存储库是免费的,订阅计划可用于多个存储库。
该服务目前未与 CodePipeline 集成,但即将推出。
如果您想自己构建一些东西,您可以在 GitHub 上进行新的集成,它使用 webhook 功能来触发 lambda 函数,这反过来会触发您的 CodeBuild 作业或将工件推送到 S3 以启动代码管道。
Full disclosure I am the author of this service
CodeBuild 现在直接支持构建 GitHub 拉取请求(无需 Lambda 中间步骤),如果您只是想 运行 将构建作为 PR 的一部分。 运行要将 CodePipeline 作为 PR 的一部分执行更多步骤,您仍然需要按照其他答案的建议设置一些脚手架。
https://aws.amazon.com/about-aws/whats-new/2017/09/aws-codebuild-now-supports-building-github-pull-requests/
我想做的是使用标准 AWS 工具创建以下 CI 流程:运行 在 Github 中创建合并请求时构建提交或更新。或者 运行 根据我的命令构建任何分支。与 Codeship、Travis 和许多其他 CI 服务提供的非常相似。
CodeBuild + CodePipeline 可以吗?我注意到我必须在 CodePipeline 中指定确切的分支,不幸的是,找不到如何将 Github 拉取请求集成到其中。也许我忽略了它?
看起来这可以通过使用 Lambda 和 S3 手动完成 - https://aws.amazon.com/blogs/devops/integrating-git-with-aws-codepipeline/
Webhooks notify a remote service by issuing an HTTP POST when a commit is pushed to the repository. AWS Lambda receives the HTTP POST through Amazon API Gateway, and then downloads a copy of the repository. It places a zipped copy of the repository into a versioned S3 bucket. AWS CodePipeline can then use the zip file in S3 as a source; the pipeline will be triggered whenever the Git repository is updated.
CodePipeline 确实支持与 GitHub 和 CodeBuild 的基本、完全托管的集成,如 Product and Service Integrations with AWS CodePipeline. With these integrations, it is possible to use CodeBuild with CodePipeline to run a build of a commit when a commit is pushed to a branch on GitHub. See Use AWS CodePipeline with AWS CodeBuild to Run Builds for details on integrating CodeBuild with CodePipeline as a Build
action provider, and see the Four-Stage Pipeline Tutorial 中所列,有关将 Github 与 CodePipeline 作为 Source
集成的详细信息动作提供者。
目前Github中的Pull Request功能在官方CodePipeline集成中不支持,你没有忽略任何东西。对于一个有趣的 AWS 生态系统开源项目(还不是 v1.0),它确实支持 GitHub Pull Request 集成(尽管 not yet CodePipeline), you might want to check out LambCI.
您可以尝试 https://www.deploytoproduction.com Github 拉取请求构建状态与 AWS CodeBuild 的集成。单个 Github 存储库是免费的,订阅计划可用于多个存储库。 该服务目前未与 CodePipeline 集成,但即将推出。
如果您想自己构建一些东西,您可以在 GitHub 上进行新的集成,它使用 webhook 功能来触发 lambda 函数,这反过来会触发您的 CodeBuild 作业或将工件推送到 S3 以启动代码管道。
Full disclosure I am the author of this service
CodeBuild 现在直接支持构建 GitHub 拉取请求(无需 Lambda 中间步骤),如果您只是想 运行 将构建作为 PR 的一部分。 运行要将 CodePipeline 作为 PR 的一部分执行更多步骤,您仍然需要按照其他答案的建议设置一些脚手架。 https://aws.amazon.com/about-aws/whats-new/2017/09/aws-codebuild-now-supports-building-github-pull-requests/