I'm trying to use AWS CodeBuild to get all files and subfolders inside a nested public
folder and deploy to an S3 bucket using CodePipeline. I was able to hook them all together but struggling to configure the buildspec.yml
file to get the output I want.
My folder structure:
<path>/public/
├── 404.html
├── css
│ ├── ...
├── fonts
│ ├── bootstrap
│ │ ├── ...
│ ├── icomoon
│ │ ├── icomoon
│ │ │ ├── ...
│ └── simple-line-icons
│ ├── ...
├── images
│ ├── ...
├── index.html
├── index.xml
├── js
│ ├── ...
└── tags
└── index.xml
I need to put everything (including the subfolders) inside the public
folder into the root of an S3 bucket.
So far I've tried following the docs here, here and here. I've tried using:
**/*
to get everything recursively inside the folderpublic
but the S3 bucket will have the path to the folder so theindex.html
is not in the root.discard-paths: yes
to remove the path to thepublic
folder but inside the S3 bucket, all files are there in the root, no sub-folder structure is kept.base-directory
: as described here.artifacts: secondary-artifacts: artifact1: files: - directory/file artifact2: files: - directory/file2
to keep the folder structure but my build failed.- Different combinations of all the syntaxes above but my build just failed.
files
straight afterartifacts
too, regardless of secondary artifacts, otherwise it will always fail – Headliner