-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
45 lines (25 loc) · 798 Bytes
/
install.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
#!/bin/bash
# Installing NodeJS and NPM
echo "Fetching nvm..."
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
chmod +x ~/.nvm/nvm.sh
source ~/.nvm/nvm.sh
echo "Installing node..."
nvm install 12.20.1
npm install -g [email protected]
echo "Installed! 🎉"
node -v && npm -v
# Installing PostgreSQL and Setting User password
sudo apt-get update
sudo apt-get -y install postgresql postgresql-contrib
sudo service postgresql start
# Changing Password
sudo -u postgres psql -U postgres -d postgres -c "alter user postgres with password 'password';"
echo "Creating .env file..."
echo "PG_USER = postgres
PG_PASSWORD = password
PG_HOST = localhost
PG_PORT = 5432
PG_DATABASE = db_memes" > .env
# Creating DB
cat database/db_schema.sql | sudo -u postgres psql