~vesto/groovebuoy

d4e6b461ad8dac6eecaa8afc6e9a8d1d5efd425d — Steve Gattuso 4 years ago cfd0368 + 129ea9a
Merge pull request #3 from crertel/add-setup-script

Create simple setup helper script.
2 files changed, 52 insertions(+), 9 deletions(-)

M README.md
A setup.sh
M README.md => README.md +2 -9
@@ 19,17 19,10 @@ Clone the repo:
$ git clone https://github.com/stevenleeg/groovebuoy.git
```

Install dependencies:
Run setup:

```
$ yarn install
```

Set up needed environment variables:

```
cp .env.example .env
"${EDITOR:-vi}" .env # You may want to change the defaults, otherwise skip this
$ ./setup.sh
```

Spin up a local webserver:

A setup.sh => setup.sh +50 -0
@@ 0,0 1,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
\ No newline at end of file