dnote/scripts/vagrant/bootstrap.sh
Sung Won Cho 4a3fd2d1a7
Use Vagrant for easy development setup (#297)
* Use vagrant

* Stop using polling

* Fix test

* Document

* Fix
2019-11-03 20:04:17 -08:00

17 lines
688 B
Bash
Executable file

#!/usr/bin/env bash
set -ex
echo "export DNOTE=/go/src/github.com/dnote/dnote" >> /home/vagrant/.bash_profile
echo "cd /go/src/github.com/dnote/dnote" >> /home/vagrant/.bash_profile
# install dependencies
(cd /go/src/github.com/dnote/dnote && make install)
# set up database
sudo -u postgres createdb dnote
sudo -u postgres createdb dnote_test
# allow connection from host and allow to connect without password
sudo sed -i "/port*/a listen_addresses = '*'" /etc/postgresql/11/main/postgresql.conf
sudo sed -i 's/host.*all.*.all.*md5/# &/' /etc/postgresql/11/main/pg_hba.conf
sudo sed -i "$ a host all all all trust" /etc/postgresql/11/main/pg_hba.conf
sudo service postgresql restart