代码之家  ›  专栏  ›  技术社区  ›  Jiew Meng

我是否可以使代码管道仅在手动触发时执行

  •  2
  • Jiew Meng  · 技术社区  · 7 年前

    我有一个代码管道设置。但现在我只想在手动触发管道时让它运行,这可能吗?

    1 回复  |  直到 7 年前
        1
  •  3
  •   Yannick Schuchmann    6 年前

    这对我很有用:

    建立一个定期的管道 GithubWebhook 设置 这将创建并注册一个内部aws webhook。 然后只需取消注册并删除webhook like it is written in the aws docs 通过aws cli。

    根据您所在的地区调整以下内容,我的是us-east-2:

    查找webhook的名称:

    aws codepipeline list-webhooks
    

    注销:

    aws codepipeline deregister-webhook-with-third-party --webhook-name <webhook-name>
    

    删除:

    aws codepipeline delete-webhook --name <webhook-name>
    

    注: 有必要将源步骤配置为使用 GithubWebhook .

    现在,您可以通过AWS控制台或AWS cli手动触发管道,方法是:

    aws codepipeline start-pipeline-execution --name <pipeline-name>
    
        2
  •  2
  •   Tranquiliser    7 年前

    您需要将代码管道配置为由CloudWatch事件触发。完成后,将在CloudWatch下创建一个名为“codepipeline-{repository_name}”的事件规则。

    禁用此规则将停止CodeCommit触发的CodePipeline。当您需要构建时,只需单击“发布更改”按钮。

        3
  •  0
  •   Simon Ernesto Cardenas Zarate    7 年前

    您可以使用CloudWatch事件,以避免触发管道:

    https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-trigger-source-schedule-console.html

    设置一个cronjob will never execute ,然后您可以随时通过单击“发布更改”按钮手动触发管道。 我还没有测试过,但我认为应该可以。