Skip to content

Instantly share code, notes, and snippets.

@Lewiscowles1986
Created November 11, 2015 22:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Lewiscowles1986/65ad9e30b33dd25790b8 to your computer and use it in GitHub Desktop.
Save Lewiscowles1986/65ad9e30b33dd25790b8 to your computer and use it in GitHub Desktop.
HospitalRun.io vagrant test env
#!/bin/bash
# Install NodeJS via NVM
sudo apt-get install -y git-core curl
curl https://raw.githubusercontent.com/creationix/nvm/v0.3.0/install.sh | bash
echo "source /home/vagrant/.nvm/nvm.sh" >> /home/vagrant/.profile
source /home/vagrant/.profile
nvm install 0.12
nvm alias default 0.12
# Install bower
npm install -g bower
# Compile CouchDB
# http://wiki.apache.org/couchdb/Installing_on_Ubuntu
# http://docs.couchdb.org/en/latest/install/unix.html
COUCHDBVER="1.6.1"
apt-get update
apt-get install -qq g++ make curl erlang-dev erlang-manpages erlang-base-hipe erlang-eunit erlang-nox erlang-xmerl erlang-inets libmozjs185-dev libicu-dev libcurl4-gnutls-dev libtool
wget -q "https://www.apache.org/dyn/closer.lua?path=/couchdb/source/${COUCHDBVER}/apache-couchdb-${COUCHDBVER}.tar.gz"
tar xfz "apache-couchdb-${COUCHDBVER}.tar.gz"
cd "apache-couchdb-${COUCHDBVER}"
./configure
make
make install
apt-get autoclean -qq
apt-get autoremove purge -qq
adduser --system \
--home /usr/local/var/lib/couchdb \
--no-create-home \
--shell /bin/bash \
--group --gecos \
"CouchDB Administrator" couchdb
chown -R couchdb:couchdb /usr/local/etc/couchdb
chown -R couchdb:couchdb /usr/local/var/lib/couchdb
chown -R couchdb:couchdb /usr/local/var/log/couchdb
chown -R couchdb:couchdb /usr/local/var/run/couchdb
chmod 0770 /usr/local/etc/couchdb
chmod 0770 /usr/local/var/lib/couchdb
chmod 0770 /usr/local/var/log/couchdb
chmod 0770 /usr/local/var/run/couchdb
ln -s /usr/local/etc/logrotate.d/couchdb /etc/logrotate.d/couchdb
ln -s /usr/local/etc/init.d/couchdb /etc/init.d
update-rc.d couchdb defaults
echo -e "\n[httpd]\nbind_address = 0.0.0.0" >>/usr/local/etc/couchdb/local.ini
service couchdb start
# Fetch Hospitalrun.io
git clone --depth=1 https://github.com/HospitalRun/hospitalrun-frontend hospitalrun.io
# Basic testing setup
cd hospitalrun.io
./initcouch.sh
cp server/config-example.js server/config.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment