开始自动运行构建 (AWS CLI) - AWS CodeBuild
AWS 文档中描述的 AWS 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅中国的 AWS 服务入门

开始自动运行构建 (AWS CLI)

If your source code is stored in a GitHub or a GitHub Enterprise Server repository, you can use GitHub webhooks to have AWS CodeBuild rebuild your source code whenever a code change is pushed to the repository.

运行 create-webhook 命令,如下所示:

aws codebuild create-webhook --project-name <project-name>

<project-name> is the name of the build project that contains the source code to be rebuilt.

For GitHub, information similar to the following appears in the output:

{ "webhook": { "url": "<url>" } }

<url> is the URL to the GitHub webhook.

For GitHub Enterprise Server, information similar to the following appears in the output:

  1. 从输出中复制私有密钥和负载 URL。You need them to add a webhook in GitHub Enterprise Server.

  2. In GitHub Enterprise Server, choose the repository where your CodeBuild project is stored. 选择 Settings (设置),选择 Hooks & services (挂钩和服务),然后选择 Add webhook (添加 webhook).

  3. 输入负载 URL 和私有密钥,接受其他字段的默认值,然后选择 Add webhook.