buildspec.yml Example:
version: 0.2
phases:
install:
runtime-versions:
nodejs: 18
pre_build:
commands:
- npm install
build:
commands:
- npm run build
- npm test
post_build:
commands:
- echo "Build completed"
artifacts:
files:
- '**/*'
base-directory: dist
cache:
paths:
- node_modules/**/*
appspec.yml (EC2):
version: 0.0
os: linux
files:
- source: /
destination: /var/www/html
hooks:
BeforeInstall:
- location: scripts/before_install.sh
AfterInstall:
- location: scripts/after_install.sh
ApplicationStart:
- location: scripts/start.sh
ValidateService:
- location: scripts/validate.sh
Tiếp theo: Quiz Tuần 8