【发布时间】:2020-10-14 04:15:26
【问题描述】:
我正在尝试将网站从 Heroku 迁移到 AWS,但在使用 CodeBuild 时遇到了问题。源代码在 GitHub 上,我使用的是 CodePipeline - CodeBuild - Elastic Beanstalk。管道运行良好,似乎代码正在进入 Elastic Beanstalk。但是,我被困在 CodeBuild 步骤。 (buildspec.yml 如下)
日志似乎可以正常运行命令,但是当我将构建输出到 S3 存储桶时,没有构建文件夹。这就是我在使用 Elastic Beanstalk 时遇到的问题……它没有找到构建文件夹来呈现前端。我错过了什么??
buildspec.yml:
version: 0.2
phases:
install:
commands:
# Install Node
- echo Installing Node 12...
- curl -sL https://deb.nodesource.com/setup_12.x | bash -
- apt install -y nodejs
pre_build:
commands:
#install dependencies
- echo Installing dependencies...
- npm install
build:
commands:
#build
- echo Building...
- npm run build
artifacts:
files:
"**/*"
discard-paths: no
base-directory: client/build
网站使用 MySQL、Express、React、NodeJS 构建
【问题讨论】:
标签: node.js reactjs amazon-web-services aws-codebuild