-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.sh
executable file
·50 lines (34 loc) · 1.35 KB
/
setup.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
#! /bin/bash
set -eou pipefail
cat <<EOF
____ ____ U ___ u U ___ u__ __ U _____ u ____ _ _ U ___ u__ __
U /"___|uU | _"\ u \/"_ \/ \/"_ \/\ \ /"/u\| ___"|/U | __")uU |"|u| | \/"_ \/\ \ / /
\| | _ / \| |_) |/ | | | | | | | | \ \ / // | _|" \| _ \/ \| |\| | | | | | \ V /
| |_| | | _ <.-,_| |_| |.-,_| |_| | /\ V /_,-.| |___ | |_) | | |_| |.-,_| |_| |U_|"|_u
\____| |_| \_\\_)-\___/ \_)-\___/ U \_/-(_/ |_____| |____/ <<\___/ \_)-\___/ |_|
_)(|_ // \\_ \\ \\ // << >> _|| \\_ (__) )( \\ .-,//|(_
(__)__) (__) (__) (__) (__) (__) (__) (__)(__) (__) (__) (__) \_) (__)
EOF
read -r -p "Enter server name [Development at Localhost Buoy]: " server_name
read -r -p "Enter buoy host [localhost:8000]: " server_host
printf "Creating env config..."
BUOY_ID="$(uuidgen -r)"
BUOY_HOST=${server_host:-"localhost:8000"}
SSL_ENABLED=0
BUOY_NAME=${server_name:-"Development at Localhost Buoy"}
JWT_SECRET="$(openssl rand -base64 32)"
cat <<EOF > .env
BUOY_ID="${BUOY_ID}"
BUOY_HOST="${BUOY_HOST}"
SSL_ENABLED=${SSL_ENABLED}
BUOY_NAME="${BUOY_NAME}"
JWT_SECRET="${JWT_SECRET}"
EOF
printf "done.\\n"
printf "Installing groovebuoy..."
yarn install
cat <<EOF
!!! Groovebuoy installed !!!
To start your bouy, please run:
$ yarn start
EOF