在AWS-CodePipeline管道中使用两个来源 [英] Use two sources in an AWS-CodePipeline pipeline

本文介绍了在AWS-CodePipeline管道中使用两个来源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个特定的案例,我不确定AWS CodePipeline是否可以使用,我在Google文档和活动中没有通过谷歌搜索找到有关此信息的任何信息.

I have a specific case which I'm not sure if it's possible with AWS CodePipeline, and I didn't find any information about it in the documentation and event by googling....

所以我想知道是否可以在管道中设置两个源(它可以处于同一阶段,也可以处于不同阶段).

So I would like to know if I can set two sources in a pipeline (it could be in the same stage or different stages).

这是我的用例:

  • 我希望在s3存储桶中修改文件(特定对象)后启动管道
  • 当此文件更改并触发管道时,我想克隆一个代码提交存储库,然后处理构建和其他阶段...
  • 另一方面,当我的代码提交存储库的master分支上有一个提交时,我希望管道启动并构建我的源代码.
  • 因此,当更改来自s3或代码提交时,应触发管道
  • 我不想在我的代码提交存储库中对s3文件进行版本控制,因为它应该由除git存储库之外的开发团队以外的其他团队加密和使用
  • 无论何时我的管道从s3存储桶更改或代码提交推送开始,我都应从存储库中获取提交以进行构建...

我不知道我的目标规范是否明确,如果可以,是否可以如上所述在管道中使用两个源操作以及如何实现这一目标?

I don't know if my objectives specifications are clear, if yes is it possible to use two source actions in a pipeline as described above and how to achieve this?

谢谢.

干杯,欧仁·NG

推荐答案

是.AWS CodePipeline可能有两个来源.或很多事情.这两个来源必须在您的第一阶段.

Yes. It is possible to have two sources for an AWS CodePipeline. Or many for that matter. The two sources have to be in your first stage.

然后在构建阶段属性中,需要告诉您您期望有两个来源.

Then in your build phase properties, you need to tell it that you are expecting two sources.

然后告诉构建项目,这是您的主要来源.这将是您希望构建项目执行代码构建的一个.

Then tell the build project which is your primary source. This is going to be the one that you want your build project to execute the codebuild.

然后从您的buildspec或您调用的任何脚本中,通过引用以下内容来访问源目录:

From your buildspec or from any scripts you call, you can then access the source directories by referencing:

  • $ CODEBUILD_SRC_DIR_SourceOutput1

  • $CODEBUILD_SRC_DIR_SourceOutput1

$ CODEBUILD_SRC_DIR_SourceOutput2

$CODEBUILD_SRC_DIR_SourceOutput2

只需将上面的SourceOutputX替换为您从源阶段调用的输出即可.

Just replace SourceOutputX above with what you call your output from the source stage.

我找到了以下具有更多信息的链接: https://docs.aws.amazon.com/codebuild/latest/userguide/sample-multi-in-out.html

I found the following link with more information: https://docs.aws.amazon.com/codebuild/latest/userguide/sample-multi-in-out.html

这篇关于在AWS-CodePipeline管道中使用两个来源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆