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년 전532회 조회
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
전문가
검토됨 한 달 전
  • Thank you. Makes sense. I assume that means a build stage is required prior to define the more granular artifact?

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠