forked from Monash-FIT3170/Onboarder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildspec.yml
31 lines (29 loc) · 892 Bytes
/
buildspec.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
version: 0.2
phases:
install:
runtime-versions:
python: 3.12
pre_build:
commands:
- echo "Installing dependencies..."
- pip install -r backend/requirements.txt
- echo "Downloading env.json from S3..."
- aws s3 cp s3://onboarder-envbucket/env.json .
build:
commands:
- echo "Building the Lambda function..."
- mkdir -p dist
- cd backend/lambda
- zip -r ../../dist/function.zip . -x "*.pyc"
- cd ../..
post_build:
commands:
- echo "Deploying the Lambda function..."
- sam package --template-file sam.yml --s3-bucket onboarder-test-upload-bucket --output-template-file dist/packaged.yml
- sam deploy --template-file dist/packaged.yml --stack-name my-lambda-stack --capabilities CAPABILITY_IAM
artifacts:
files:
- function.zip
- packaged.yml
- appspec.yml
base-directory: dist