【发布时间】:2021-11-27 22:25:43
【问题描述】:
我可以在我的 IAC 定义(即 codebuild.yaml 和/或 buildspec.yaml 文件)中设置哪些字段来让我的 AWS CodeBuild 进程执行完整的 git 克隆?
我有一个用例,在构建过程中使用每个文件的最后更新日期,而这些日期不适用于浅层克隆。
【问题讨论】:
标签: git amazon-web-services aws-codebuild infrastructure-as-code
我可以在我的 IAC 定义(即 codebuild.yaml 和/或 buildspec.yaml 文件)中设置哪些字段来让我的 AWS CodeBuild 进程执行完整的 git 克隆?
我有一个用例,在构建过程中使用每个文件的最后更新日期,而这些日期不适用于浅层克隆。
【问题讨论】:
标签: git amazon-web-services aws-codebuild infrastructure-as-code
如果您希望利用 codecommit,您可以通过添加远程克隆功能来执行克隆:
phases:
install:
commands:
- pip install git-remote-codecommit
pre_build:
commands:
- echo CLONE DIRECTORIES
- git clone codecommit://[repo name] [target folder name]
您需要确保您的 IAM 角色具有访问 Codecommit 的适当权限。如果您正在寻找 Github 克隆,请参阅此链接:
https://docs.aws.amazon.com/codepipeline/latest/userguide/tutorials-github-gitclone.html
【讨论】:
我终于想出了如何进行完整克隆。我在此链接中发布了它。检查一下,我想它会给你你正在寻找的东西: Setting credentials for https git clone in AWS CodeBuild
【讨论】: