-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy-example.sh
More file actions
30 lines (19 loc) · 913 Bytes
/
deploy-example.sh
File metadata and controls
30 lines (19 loc) · 913 Bytes
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
# /bin/bash
export API_NAME="github-ia-back-end"
export STAGE="v1"
export AWS_DEFAULT_REGION="us-east-1"
export ACCOUNT_ID=""
if ! aws s3 ls s3://$API_NAME-$AWS_DEFAULT_REGION-$ACCOUNT_ID; then
aws s3 mb s3://$API_NAME-$AWS_DEFAULT_REGION-$ACCOUNT_ID
aws s3api put-bucket-tagging --bucket $API_NAME-$AWS_DEFAULT_REGION-$ACCOUNT_ID --tagging 'TagSet=[{Key=owner,Value=gustavo.mainchein},{Key=project,Value=study}]'
aws s3api put-bucket-versioning --bucket $API_NAME-$AWS_DEFAULT_REGION-$ACCOUNT_ID --versioning-configuration Status=Enabled
fi
python3 -m venv venv
source venv/bin/activate
mkdir -p src/layers/common/python/lib/python3.12/site-packages
pip install --upgrade pip
pip install --no-cache-dir -r layers/common/requirements.txt -t src/layers/common/python/lib/python3.12/site-packages
sls deploy --stage=$STAGE --param="API_NAME=$API_NAME"
rm -rf src/layers
deactivate
rm -rf venv