带有 GitHub 的 AWS CodeBuild - 仅适用于特定目录 [英] AWS CodeBuild with GitHub - only for specific directory

查看:38
本文介绍了带有 GitHub 的 AWS CodeBuild - 仅适用于特定目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 AWS Pipeline、S3 和 CodeBuild 为 Angular 2 应用程序设置自动部署.

I am trying to set up automatic deployment for the Angular 2 app with AWS Pipeline, S3 and CodeBuild.

关注 Andrés 的 教程我能够将 CodeBuild 连接到 GitHub 存储库,并且该过程运行良好.

Following Andrés' tutorial I was able to connect CodeBuild the GitHub repo and the process works great.

然而,我们的 Angular 应用程序位于更大的 repo 的子目录中.

However, our Angular app lives inside a subdirectory of the bigger repo.

有没有办法在 repo 中指定一个目录,以便只有在子目录更改时才会触发构建?

Is there a way to specify a directory inside a repo, so that the build will only be triggered if the subdirectory changed?

非常感谢.

推荐答案

看起来您不能只下拉某个文件夹,而是可以指定用于构建的目录的构建规范的工件.

It doesn't look like you can just pull down a certain folder but the artifact for the build spec you can specify the directories that are used for the build.

对于 GitHub,对于可选的 Source version 值,键入与您要构建的源代码版本对应的提交 ID、拉取请求 ID、分支名称或标签名称.如果指定了拉取请求 ID,它必须使用格式 pr/pull-request-ID(例如,pr/25).如果指定了分支名称,则将使用分支的 HEAD 提交 ID.如果 Source version 为空,则将使用默认分支的 HEAD 提交 ID.

For GitHub, for the optional Source version value, type a commit ID, a pull request ID, a branch name, or a tag name that corresponds to the version of the source code you want to build. If a pull request ID is specified, it must use the format pr/pull-request-ID (for example, pr/25). If a branch name is specified, the branch's HEAD commit ID will be used. If Source version is blank, the default branch's HEAD commit ID will be used.

http://docs.aws.amazon.com/codebuild/latest/userguide/run-build.html

artifacts 可选序列.表示有关 AWS CodeBuild 可以在何处找到构建输出以及 AWS CodeBuild 如何准备将其上传到 Amazon S3 输出存储桶的信息.例如,如果您正在构建 Docker 映像并将其推送到 Amazon ECR,或者您正在对源代码运行单元测试但未构建它,则不需要此序列.文件:必需的序列.表示构建环境中包含构建输出工件的位置.包含一系列标量,每个标量代表一个单独的位置,AWS CodeBuild 可以在其中找到相对于原始构建位置的构建输出工件.位置可以包括以下内容:单个文件(例如,my-file.jar).子目录中的单个文件(例如,my-subdirectory/my-file.jar 或 my-parent-subdirectory/my-subdirectory/my-file.jar).'/' 递归地表示所有文件.my-subdirectory/ 表示名为 my-subdirectory 的子目录中的所有文件.my-subdirectory//* 表示从名为 my-subdirectory 的子目录开始递归的所有文件.

artifacts Optional sequence. Represents information about where AWS CodeBuild can find the build output and how AWS CodeBuild will prepare it for uploading to the Amazon S3 output bucket. This sequence is not required if, for example, you are building and pushing a Docker image to Amazon ECR, or you are running unit tests on your source code but not building it. files: Required sequence. Represents the locations containing the build output artifacts in the build environment. Contains a sequence of scalars, with each scalar representing a separate location where AWS CodeBuild can find build output artifacts, relative to the original build location. Locations can include the following: A single file (for example, my-file.jar). A single file in a subdirectory (for example, my-subdirectory/my-file.jar or my-parent-subdirectory/my-subdirectory/my-file.jar). '/' represents all files recursively. my-subdirectory/ represents all files in a subdirectory named my-subdirectory. my-subdirectory//* represents all files recursively starting from a subdirectory named my-subdirectory.

http://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html

这篇关于带有 GitHub 的 AWS CodeBuild - 仅适用于特定目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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