Deploy only a subset of source using CodeDeploy S3 provider

0

Hi,

I have a CodeCommit repository and CodePipeline pipeline which I'm using for a web application. The application includes some javascript I'd like to deploy to S3. As far as I can tell, the S3 action provider of CodeDeploy copies the whole source artefact to the target bucket. Is there any way of being selective about the parts of the repo to publish? For example it'd be great if I could only deploy the "publicsite" subdirectory to S3. I guess I could script this separately somewhere in the build, but I'd like to keep things as simple as possible.

Thanks

質問済み 2年前531ビュー
1回答
1
承認された回答

The most granular thing CodeDeploy can deploy is a build artifact. Think of an artifact as "a group of files that should be deployed to a single destination". So if you want to deploy only your "publicsite" files to S3 you'll need to define a separate build artifact that includes only those files.

I use this approach in my own projects when I want to deploy my web app to one server and my generated documentation to a different server, for example. Here's an example of how my documentation artifact is defined in the buildspec.yml:

artifacts:
    files:
        - '**/*'
    base-directory: docs/user-guide
    name: DocBuildOutput
profile pictureAWS
Kris
回答済み 2年前
profile picture
エキスパート
レビュー済み 1ヶ月前
  • Thank you. Makes sense. I assume that means a build stage is required prior to define the more granular artifact?

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ