-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdeploy.sh
More file actions
29 lines (23 loc) · 763 Bytes
/
deploy.sh
File metadata and controls
29 lines (23 loc) · 763 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
#!/bin/bash
# @marekq
# www.marek.rocks
############################################################
# set color variables
RED='\033[0;31m'
NC='\033[0m'
# retrieve the lambda python dependancies
echo -e "\n${RED} * Running SAM build locally to retrieve Python libraries... ${NC}\n"
sam build --use-container
# validate the sam stack
echo -e "\n${RED} * Running SAM validate locally to test function... ${NC}\n"
sam validate
# deploy the sam stack to the aws region
echo -e "\n${RED} * Deploying the SAM stack to AWS... ${NC}\n"
# check if samconfig.toml file is present
if [ ! -f samconfig.toml ]; then
echo "no samconfig.toml found, starting guided deploy"
sam deploy -g
else
echo "samconfig.toml found, proceeding to deploy"
sam deploy
fi