编辑 AWS CodeBuild 触发器 - AWS CodeBuild
AWS 文档中描述的 AWS 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅中国的 AWS 服务入门

编辑 AWS CodeBuild 触发器

您可以在项目上编辑触发器以安排每小时、每天或每周进行一次构建。您也可以编辑触发器以将自定义规则与 Amazon CloudWatch cron 表达式结合使用。例如,通过使用 cron 表达式,您可以安排在每个工作日的特定时间进行构建。有关创建触发器的信息,请参阅创建 AWS CodeBuild 触发器

要编辑触发器,请执行以下操作:

  1. Open the AWS CodeBuild console at https://console.amazonaws.cn/codesuite/codebuild/home.

  2. 在导航窗格中,选择 Build projects

  3. 选择要更改的生成项目的链接,然后选择 Build triggers (生成触发器) 选项卡。

    注意

    By default, the 100 most recent build projects are displayed. To view more build projects, choose the gear icon, and then choose a different value for Projects per page or use the back and forward arrows.

  4. 选择您要更改的触发器旁边的单选按钮,然后选择编辑

  5. From the Frequency drop-down list, choose the frequency for your trigger. If you want to create a frequency using a cron expression, choose Custom.

  6. Specify the parameters for the frequency of your trigger. You can enter the first few characters of your selections in the text box to filter drop-down menu items.

    注意

    Start hours and minutes are zero-based. The start minute is a number between zero and 59. The start hour is a number between zero and 23. For example, a daily trigger that starts every day at 12:15 P.M. has a start hour of 12 and a start minute of 15. A daily trigger that starts every day at midnight has a start hour of zero and a start minute of zero. A daily trigger that starts every day at 11:59 P.M. has a start hour of 23 and a start minute of 59.

    Frequency Required Parameters Details
    Hourly

    Start minute

    Use the Start minute drop-down menu.

    Daily

    Start minute

    Start hour

    Use the Start minute drop-down menu.

    Use the Start hour drop-down menu.

    Weekly

    Start minute

    Start hour

    Start day

    Use the Start minute drop-down menu.

    Use the Start hour drop-down menu.

    Use the Start day drop-down menu.

    Custom

    Cron expression

    Enter a cron expression in Cron expression. A cron expression has six required fields that are separated by white space. The fields specify a start value for minute, hour, day of month, month, day of week, and year. You can use wildcards to specify a range, additional values, and more. For example, the cron expression 0 9 ? * MON-FRI * schedules a build every weekday at 9:00 A.M. For more information, see Cron Expressions in the Amazon CloudWatch Events User Guide.

  7. Select Enable this trigger.

注意

您可以使用 https://console.amazonaws.cn/cloudwatch/ 上的 Amazon CloudWatch 控制台来编辑源版本、超时以及 AWS CodeBuild 中不可用的其他选项。