-
Notifications
You must be signed in to change notification settings - Fork 1
/
buildspec.yaml
23 lines (22 loc) · 948 Bytes
/
buildspec.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
version: 0.2
phases:
install:
runtime-versions:
nodejs: 18
commands:
- npm install -g aws-sdk
build:
commands:
- npm install --omit=dev
- aws secretsmanager get-secret-value --secret-id nft-or-not-production-api --region us-east-1 --query SecretString --output text > env_vars.json
- jq -r 'to_entries[] | [.key, .value] | join("=")' env_vars.json > nftornot.env
- . ./nftornot.env
- aws lambda update-function-configuration --function-name nft-or-not-production-lambda --region us-east-1 --environment "{\"Variables\":`cat env_vars.json`}"
- sleep 30
- echo "The current working directory is $(pwd)"
- zip -r deploy.zip ./* -x env_vars.json -x nftornot.env
- node db/seed.js
- node db/migrate.js
post_build:
commands:
- aws lambda update-function-code --function-name=nft-or-not-production-lambda --region us-east-1 --zip-file=fileb://deploy.zip