I have a react application that I want hosted on AWS Elastic Beanstalk, from here on I will refer to Elastic Beanstalk as EB. The apps Continuous Integration/Continuous Deployment pipeline is running on AWS CodePipeline, Code Build and Code Deploy. These are all managed services offered from AWS.
When I push a commit to github it will then trigger the pipeline. This pipeline will pull the latest from github and then do a build. During this build process it runs npm install and then it builds the application bundle.
Below is the Code Build spec file. These are the build instructions. These run before the application is deployed.
version: 0.2
phases:
install:
runtime-versions:
nodejs: 10
commands:
- cd $CODEBUILD_SRC_DIR; npm install
build:
commands:
- cd $CODEBUILD_SRC_DIR; npm run build
post_build:
commands:
- cd $CODEBUILD_SRC_DIR; mv package.json _package.json
artifacts:
files:
- "**/*"
base-directory: "."
discard-paths: no




