pipeline repo path #12617
-
This is more of an aws question but its relevant here because my cdk projects include cdk config not just the website code. i have a simple pipeline setup to react to codecommit event and deploy the code to s3. With a cdk project the repo contains cdk config and iac, is there a way to select only the folder from codecommit that contains the website code to deploy to s3? i cant see an option for this in codepipelineactions.CodeCommitSourceAction, nor in codepipelineactions.S3DeployAction. will i need to add a manual step in between with a lambda that extract just the folder i need from the artifact zip? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
Do you have any build step between the source and the deployment? |
Beta Was this translation helpful? Give feedback.
-
That would make it easier but in this case it's not needed as it's a very basic HTML site. (Actually an older site that client has no budget for to do big updates but I still want to streamline deployment for smaller text changes). I'm experimenting a bit with a lambda step at the moment. |
Beta Was this translation helpful? Give feedback.
-
I would just stick a CodeBuild step after source, and do something like this in the buildspec: artifacts: {
'base-directory': 'your-dir',
files: '**/*',
} The output artifact of that job will have only the files in |
Beta Was this translation helpful? Give feedback.
-
CodeBuild would work and probably easier but it just seemed like overkill for a static website. I have made a lambda that can do what I need. The full pipeline is described here: https://www.binarythinktank.com/blog/static-site-deployment-cdk-aws |
Beta Was this translation helpful? Give feedback.
-
In my opinion, a CodeBuild Project is way less overhead (literally a few lines of CDK code) than a Lambda, that you have to write separate logic for 🙂. But hey, if it's working for you, that's great 🙂. |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
I would just stick a CodeBuild step after source, and do something like this in the buildspec:
The output artifact of that job will have only the files in
your-dir
, and you can use that in subsequent stages.