-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbootstrap.sh
45 lines (33 loc) · 1.18 KB
/
bootstrap.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/sh
sudo apt-get update
sudo apt-get upgrade
# installing PostgreSQL & disabling user password (dont run this on prod ;P)...
sudo apt-get install -y postgresql-9.4 postgresql-client-9.4
sudo -u 'postgres' psql -c "ALTER ROLE postgres WITH PASSWORD ''" 1>/dev/null
# init the postgres service
cd /etc/postgresql/9.4/main
sudo rm -f pg_hba.conf
cat | sudo -u postgres tee pg_hba.conf <<- EOM
local all all trust
host all all all trust
EOM
sudo sed -i "s/#listen_addresses = 'localhost'/listen_addresses = '*'/" "postgresql.conf"
sudo service postgresql restart
cd -
# installing Git...
sudo apt-get install -y git
# installing Elixir...
wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
sudo dpkg -i erlang-solutions_1.0_all.deb && rm erlang-solutions_1.0_all.deb
sudo apt-get update
sudo apt-get install -y esl-erlang elixir rebar
# installing entice & seeding the db...
cd /vagrant/
mix local.hex --force
mix deps.get
sudo -u 'postgres' psql -c "CREATE DATABASE entice;"
sudo -u 'postgres' psql -c "CREATE DATABASE entice_test;"
MIX_ENV=dev mix ecto.migrate
MIX_ENV=dev mix run priv/repo/seeds.exs
MIX_ENV=test mix ecto.migrate
MIX_ENV=test mix run priv/repo/seeds.exs