【问题标题】:AWS CodePipeline Not Respecting CodeBuild SettingsAWS CodePipeline 不遵守 CodeBuild 设置
【发布时间】:2019-12-15 23:58:16
【问题描述】:

我目前正在使用 codepipeline、codebuild、codedeploy 和 codecommit 创建一个管道。我在将 codebuild 构建工件上传到 s3 时遇到问题,因为它不遵循我在 buildspec.yml 中设置的工件名称:

artifacts:
  files:
    - '**/build/*'
  name: build-$(date +%Y-%m-%d) 

相反,它会随机创建一个构建名称。在我的代码构建设置中,我已经启用了语义版本控制,但它似乎被代码管道忽略了,因为我可以在日志中看到,如果我运行代码管道或仅运行代码构建,生成构建工件时会有所不同。

这是仅在代码构建的日志中显示的内容:

[Container] 2019/08/08 09:28:07 Assembling file list 
[Container] 2019/08/08 09:28:07 Expanding **/build/* 
[Container] 2019/08/08 09:28:08 Found 144 file(s) 
[Container] 2019/08/08 09:28:08 Updating artifact name as  build-2019-08-08 

这是代码管道日志中显示的内容:

[Container] 2019/08/08 09:19:50 Assembling file list 
[Container] 2019/08/08 09:19:50 Expanding **/build/* 
[Container] 2019/08/08 09:19:50 Found 144 file(s) 
[Container] 2019/08/08 09:19:50 Phase complete: UPLOAD_ARTIFACTS State: SUCCEEDED 

当我运行 codepipeline 时,您可以看到 Updating artifact name as build-2019-08-08 行不存在于日志中。

有人可以帮我解决这个问题吗?

【问题讨论】:

    标签: aws-codepipeline aws-codebuild


    【解决方案1】:

    当您在 CodePipeline 中将 CodeBuild 用作构建或测试步骤时,您的管道将控制工件命名。意思是,工件命名由 CodePipeline 管理,不能被覆盖。

    您有一个 3 阶段管道,CodeCommit -> CodeBuild -> CodeDeploy。配置管道时,您可以配置作为下一阶段输入的输出工件名称。让这些工件名称由管道定义,可以使更改以版本化的方式流过。

    【讨论】:

      猜你喜欢
      • 2018-07-18
      • 1970-01-01
      • 2017-06-08
      • 1970-01-01
      • 2020-08-23
      • 2016-11-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多