【发布时间】:2019-06-26 07:09:11
【问题描述】:
我正在尝试使用 AWS CodeBuild 获取嵌套 public 文件夹中的所有文件和子文件夹,并使用 CodePipeline 部署到 S3 存储桶。我能够将它们全部连接在一起,但很难配置 buildspec.yml 文件以获得我想要的输出。
我的文件夹结构:
<path>/public/
├── 404.html
├── css
│ ├── ...
├── fonts
│ ├── bootstrap
│ │ ├── ...
│ ├── icomoon
│ │ ├── icomoon
│ │ │ ├── ...
│ └── simple-line-icons
│ ├── ...
├── images
│ ├── ...
├── index.html
├── index.xml
├── js
│ ├── ...
└── tags
└── index.xml
我需要将 public 文件夹中的所有内容(包括子文件夹)放入 S3 存储桶的根目录中。
到目前为止,我已尝试关注文档 here、here 和 here。我试过使用:
-
**/*以递归方式获取文件夹public中的所有内容,但 S3 存储桶将具有文件夹的路径,因此index.html不在根目录中。 -
discard-paths: yes删除public文件夹的路径,但在 S3 存储桶中,所有文件都在根目录中,不保留子文件夹结构。 -
base-directory:如here所述。 -
artifacts: secondary-artifacts: artifact1: files: - directory/file artifact2: files: - directory/file2保留文件夹结构,但我的构建失败。 - 以上所有语法的不同组合,但我的构建失败了。
【问题讨论】:
-
你也需要
files紧跟在artifacts之后,不管次要工件是什么,否则它总是会失败
标签: amazon-web-services amazon-s3 aws-codebuild