CodePipeline file generation

0

So I have a react with SSR project that I am trying to create a CI/CD pipeline. My project needs to deploy the following artifacts:

dist folder created by Webpack
appspec.yml file needed by Code Deploy
script folder for scripts that are references in appspec.yml
When I tried to get the files one by one using this buildspec.yml:

version: 0.2

phases:
install:
runtime-versions:
nodejs: 10
commands:
- npm install
build:
commands:
- npm run build
artifacts:
files:
- 'dist/*'
- 'appspec.yml'
- 'deploy-scripts'

I got dist with only part of it's content and the appspec.yml and the deploy scripts folder.

Then I tried a different approach:

version: 0.2

phases:
install:
runtime-versions:
nodejs: 10
commands:
- npm install
build:
commands:
- npm run build
artifacts:
files:
- '**/*'
base-directory: "dist"
discard-paths: yes

The dist folder has the scripts and the appspec file inside it. Now it does deploy, but I lose the folder structure of dist which is necessary for my deploy scripts.

I need to get all the contents of dist in their folder structure. As well as the scripts and the appspec.yml file. The scripts and the appspec.yml can't be inside dist, but dist needs to have all of it's content.

Can anyone help with this?

質問済み 5年前445ビュー
2回答
0

Hi,
Have you tried the following?

- 'dist/**/*'
回答済み 5年前
0

The suggestion did the trick. Thanks!

回答済み 5年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ