Skip to content

Instantly share code, notes, and snippets.

@vatsal2210
Created December 23, 2020 16:03
Show Gist options
  • Save vatsal2210/f6825b6863f16d572bc188040a7d758d to your computer and use it in GitHub Desktop.
Save vatsal2210/f6825b6863f16d572bc188040a7d758d to your computer and use it in GitHub Desktop.
Node.js buildspec.yml file to deploy on Elastic Beanstalk
# Do not change version. This is the version of aws buildspec, not the version of your buldspec file.
version: 0.2
phases:
install:
runtime-versions:
nodejs: 12
commands:
- echo Installing Mocha...
- npm install -g mocha
pre_build:
commands:
- echo Installing source NPM dependencies...
- npm install --only=prod -y -g --unsafe-perm
build:
commands:
- echo Build started on `date`
- echo Compiling the Node.js code
# - mocha test.js
post_build:
commands:
- echo Build completed on `date`
# Include only the files required for your application to run.
# Do not use recursively include artifacts from node_modules directory as it will include unnecessary packages
# used only for building and testing.
# ExpressJS apps will need other artifact directories included (bin/, public/, routes/, views/ etc).
artifacts:
files:
- app.js
- config/**/*
- controller/**/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment