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

preguntada hace 2 años532 visualizaciones
1 Respuesta
1
Respuesta aceptada

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
respondido hace 2 años
profile picture
EXPERTO
revisado hace un mes
  • Thank you. Makes sense. I assume that means a build stage is required prior to define the more granular artifact?

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas