aboutsummaryrefslogtreecommitdiff
path: root/vagrant/bootstrap.sh
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2014-11-21 09:01:33 +0100
committerCédric Bonhomme <cedric@cedricbonhomme.org>2014-11-21 09:01:33 +0100
commit46910ee27d19f18758d188d2991c8fc51072aba5 (patch)
treeffb06bdb1ce486fd21fc1d8686cdc7053ac30c2d /vagrant/bootstrap.sh
parentUpdated NEWS.rst (diff)
downloadnewspipe-46910ee27d19f18758d188d2991c8fc51072aba5.tar.gz
newspipe-46910ee27d19f18758d188d2991c8fc51072aba5.tar.bz2
newspipe-46910ee27d19f18758d188d2991c8fc51072aba5.zip
Test with Vagrant.
Diffstat (limited to 'vagrant/bootstrap.sh')
-rw-r--r--vagrant/bootstrap.sh44
1 files changed, 44 insertions, 0 deletions
diff --git a/vagrant/bootstrap.sh b/vagrant/bootstrap.sh
new file mode 100644
index 00000000..867553f2
--- /dev/null
+++ b/vagrant/bootstrap.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+apt-get update
+apt-get upgrade
+apt-get install -y python python-pip git
+
+# Clone the source code of pyAggr3g470r
+git clone https://bitbucket.org/cedricbonhomme/pyaggr3g470r.git
+if [ $? -ne 0 ]; then
+ echo "\nERROR: unable to clone the git repository\n"
+ exit 1;
+fi
+
+# Install all requierements
+cd pyaggr3g470r
+apt-get install -y libxml2-dev libxslt1-dev
+pip install --upgrade -r requirements.txt
+cp conf/conf.cfg-sample conf/conf.cfg
+cd ..
+
+# Installation of PostgreSQL
+apt-get install -y postgresql postgresql-server-dev-9.3 postgresql-client
+
+# Configuration of the database
+echo "127.0.0.1:5432:aggregator:vagrant:xxYzToW42" > .pgpass
+chmod 700 .pgpass
+sudo -u postgres createuser vagrant --no-superuser --createdb --no-createrole
+createdb aggregator --no-password
+echo "ALTER USER vagrant WITH ENCRYPTED PASSWORD 'xxYzToW42';" | sudo -u postgres psql
+echo "GRANT ALL PRIVILEGES ON DATABASE aggregator TO vagrant;" | sudo -u postgres psql
+
+# Initializes the database
+cd pyaggr3g470r
+python db_create.py
+
+# start pyAggr3g470r at startup
+echo "#!/bin/sh -e" > /etc/rc.local
+echo "su vagrant python runserver.py" >> /etc/rc.local
+echo "exit 0" >> /etc/rc.local
+chmod 755 /etc/rc.local
+
+# Start the application
+chown -R vagrant:vagrant ..
+/etc/init.d/rc.local start
bgstack15