-
Notifications
You must be signed in to change notification settings - Fork 1
/
wiz.sh
executable file
·54 lines (47 loc) · 1.26 KB
/
wiz.sh
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env bash
BUCKET_NAME=`cat package.json | grep 's3_bucket_name' | awk -F\" '{print $4}'`
create_s3_bucket() {
aws s3 mb "s3://${BUCKET_NAME}" # create bucket
aws s3 website "s3://${BUCKET_NAME}" --index-document index.html
}
CYAN=`tput setaf 6`
RESET_COLORS=`tput sgr0`
echo ""
echo "${CYAN}/*******************************"
echo "${CYAN} * vue-hours deploy helper *"
echo "${CYAN} *******************************/"
echo "${RESET_COLORS}"
PS3='Yo get schwifty: '
options=("Build"
"Deploy - Backend"
"Deploy - Frontend"
"Remove / Wipe Project from AWS"
"Quit")
select opt in "${options[@]}"
do
case $opt in
"Build")
npm run build
break
;;
"Deploy - Backend")
echo "TODO: deploy with build"
break
;;
"Deploy - Frontend")
create_s3_bucket
npm run build
aws s3 sync --acl public-read --sse AES256 dist/ "s3://${BUCKET_NAME}"
rm -r ./dist
break
;;
"Remove / Wipe Project from AWS")
echo "TODO: serverless wipe"
break
;;
"Quit")
break
;;
*) echo invalid option;;
esac
done