-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·39 lines (32 loc) · 799 Bytes
/
build.sh
File metadata and controls
executable file
·39 lines (32 loc) · 799 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
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bash
set -e
usage()
{
echo ""
echo ""
echo "To deploy, run ./build.sh deploy <stage> <region> <aws_profile>"
echo "To remove, run ./build.sh remove <stage> <region> <aws_profile>"
echo ""
echo "aws_profile: name of local AWS profile, to set one up run 'aws configure --profile profile_name'"
echo ""
echo "eg. ./build.sh deploy dev us-east-1 personal"
}
if [ $# -eq 0 ]; then
usage
exit 1
elif [ "$1" = "deploy" ] && [ $# -eq 4 ]; then
STAGE=$2
REGION=$3
PROFILE=$4
npm install
AWS_PROFILE=$PROFILE "node_modules/.bin/sls" deploy -s $STAGE -r $REGION
elif [ "$1" = "remove" ] && [ $# -eq 4 ]; then
STAGE=$2
REGION=$3
PROFILE=$4
npm install
AWS_PROFILE=$PROFILE "node_modules/.bin/sls" remove -s $STAGE -r $REGION
else
usage
exit 1
fi