From 569c64a520347f1cd85788dc1fb20d3b0a5c666e Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Thu, 26 Mar 2015 08:01:29 +0100 Subject: Updated Vagrant bootstrap file. --- vagrant/bootstrap.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'vagrant') diff --git a/vagrant/bootstrap.sh b/vagrant/bootstrap.sh index 1d931cf8..927a39b2 100644 --- a/vagrant/bootstrap.sh +++ b/vagrant/bootstrap.sh @@ -11,6 +11,9 @@ if [ $? -ne 0 ]; then exit 1; fi +# Installation of PostgreSQL +apt-get install -y postgresql postgresql-server-dev-9.4 postgresql-client + # Install all Python requierements cd pyaggr3g470r # For lxml @@ -25,9 +28,6 @@ sudo pip3 install feedparser==5.1.2 cp vagrant/conf.cfg-sample conf/conf.cfg cd .. -# Installation of PostgreSQL -apt-get install -y postgresql postgresql-server-dev-9.4 postgresql-client - # Configuration of the database echo "127.0.0.1:5432:aggregator:vagrant:xxYzToW42" > .pgpass chmod 700 .pgpass @@ -39,7 +39,8 @@ echo "GRANT ALL PRIVILEGES ON DATABASE aggregator TO vagrant;" | sudo -u postgre # Initializes the database cd pyaggr3g470r chown -R vagrant:vagrant . -sudo -u vagrant python3 db_create.py +sudo -u vagrant python3 manager.py db_empty +sudo -u vagrant python3 manager.py db_create # start pyAggr3g470r at startup echo "#!/bin/sh -e" > /etc/rc.local -- cgit From c2322d00e6842e7088f9452126234a2471c95f52 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Thu, 26 Mar 2015 09:09:55 +0100 Subject: Fixed configuration file for Vagrant. --- vagrant/conf.cfg-sample | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'vagrant') diff --git a/vagrant/conf.cfg-sample b/vagrant/conf.cfg-sample index 93a0b89c..fa76caad 100644 --- a/vagrant/conf.cfg-sample +++ b/vagrant/conf.cfg-sample @@ -1,10 +1,11 @@ [misc] -platform_url = https://pyaggr3g470r.herokuapp.com/ +platform_url = http://127.0.0.1:5000/ admin_email = recaptcha_public_key = recaptcha_private_key = log_path = ./pyaggr3g470r/var/pyaggr3g470r.log python = python3 +nb_worker = 5 [database] uri = postgres://vagrant:xxYzToW42@127.0.0.1:5432/aggregator [feedparser] -- cgit From 2b43c5da73ff8daa1b7b6b32f500cf9e502431c6 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Thu, 26 Mar 2015 21:16:29 +0100 Subject: Don't ask for confirmation of uninstall deletions with pip. --- vagrant/bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vagrant') diff --git a/vagrant/bootstrap.sh b/vagrant/bootstrap.sh index 927a39b2..6952afc3 100644 --- a/vagrant/bootstrap.sh +++ b/vagrant/bootstrap.sh @@ -22,7 +22,7 @@ apt-get install -y libxml2-dev libxslt1-dev sudo pip3 install --upgrade -r requirements.txt wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py sudo python3 get-pip.py -sudo pip3 uninstall feedparser +sudo pip3 uninstall -y feedparser sudo pip3 install feedparser==5.1.2 # copy of the default configuration files for vagrant cp vagrant/conf.cfg-sample conf/conf.cfg -- cgit From 8abb94bb5f915b778624b7185545b26c747430a4 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Mon, 30 Mar 2015 14:13:32 +0200 Subject: Create a cron job at the end of the bootstraping of Vagrant. --- vagrant/bootstrap.sh | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'vagrant') diff --git a/vagrant/bootstrap.sh b/vagrant/bootstrap.sh index 6952afc3..1361f69b 100644 --- a/vagrant/bootstrap.sh +++ b/vagrant/bootstrap.sh @@ -51,3 +51,12 @@ chmod 755 /etc/rc.local # Start the application. /etc/init.d/rc.local start + + +#write out current crontab +sudo -u vagrant crontab -l > mycron +#echo new cron into cron file +sudo -u vagrant echo "*/30 * * * * cd /home/vagrant/pyaggr3g470r/ ; python3 manager.py fetch_asyncio None None" >> mycron +#install new cron file +sudo -u vagrant crontab mycron +sudo -u vagrant rm mycron -- cgit From 3f760d8ad4da06e264e517d0671a6616376448ad Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Tue, 31 Mar 2015 08:44:17 +0200 Subject: Clean the directory when installing pyAggr3g470r with Vagrant. --- vagrant/bootstrap.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'vagrant') diff --git a/vagrant/bootstrap.sh b/vagrant/bootstrap.sh index 1361f69b..62747f64 100644 --- a/vagrant/bootstrap.sh +++ b/vagrant/bootstrap.sh @@ -22,6 +22,7 @@ apt-get install -y libxml2-dev libxslt1-dev sudo pip3 install --upgrade -r requirements.txt wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py sudo python3 get-pip.py +rm get-pip.py sudo pip3 uninstall -y feedparser sudo pip3 install feedparser==5.1.2 # copy of the default configuration files for vagrant -- cgit