-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup
More file actions
executable file
·42 lines (37 loc) · 1.13 KB
/
setup
File metadata and controls
executable file
·42 lines (37 loc) · 1.13 KB
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
#!/bin/bash
# Steps 1: Init submodules and install system dependencies
git submodule update --init --recursive
nvm install
nvm use
if [[ "$OSTYPE" == "darwin"* ]]; then
chmod +x mac_setup
./mac_setup
else
chmod +x linux_setup
./linux_setup
fi
# Steps 2: Install package dependencies
set -e
trap 'echo "Error encountered in $BASH_SOURCE at line $LINENO. Exiting." >&2' ERR
echo "===> Setting up the database..."
bundle exec rake db:create
echo "===> Running DB migration..."
bundle exec rake db:migrate
echo "===> Resetting dummy data inside the DB..."
bundle exec rake db:fixtures:load
# Step 3: Install yarn
if ! command -v yarn &>/dev/null; then
sudo apt install python2 -y
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update
sudo apt-get install yarn -y
npm install --global yarn
yarn install --check-files
else
echo "Yarn is already installed."
fi
yarn install --check-files
# Steps 4: Start the server
echo "===> Starting the server..."
bundle exec rake start