AWS CodeBuild无法生成构建文件夹-NodeJS [英] AWS CodeBuild not generating build folder - NodeJS

查看:140
本文介绍了AWS CodeBuild无法生成构建文件夹-NodeJS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将网站从Heroku迁移到AWS,并遇到CodeBuild的麻烦.源代码在GitHub上,我正在使用CodePipeline-CodeBuild-Elastic Beanstalk.管道运行良好,并且似乎代码正在进入Elastic Beanstalk.但是,我陷入了CodeBuild步骤. (buildspec.yml在下面)

I'm trying to migrate a website from Heroku to AWS and running into trouble with CodeBuild. The source code is on GitHub and I'm using CodePipeline - CodeBuild - Elastic Beanstalk. The Pipeline works fine and it seems like the code is making its way to Elastic Beanstalk. However, I'm stuck at the CodeBuild step. (buildspec.yml is below)

日志似乎可以很好地运行命令,但是当我将构建输出到S3存储桶时,没有构建文件夹.这就是我在Elastic Beanstalk中遇到的问题……它没有找到构建文件夹来渲染前端.我想念什么?

The logs seem to run the commands fine, but when I output the build to an S3 bucket, there is no build folder. And that's the problem I'm having with Elastic Beanstalk...it's not finding the build folder to render the front end. What am I missing??

buildspec.yml:

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构建的

Site is built with MySQL, Express, React, NodeJS

推荐答案

基于buildspec.yaml 因此,我认为您应该将当前的files部分更改为:

Thus, I think you should change your current files section into:

artifacts:
  files:
    - '**/*'

这篇关于AWS CodeBuild无法生成构建文件夹-NodeJS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆