Skip to content

Commit

Permalink
Vagrant
Browse files Browse the repository at this point in the history
Add virtualenvs
Change sed to match current values

Still can't build docs tho?
  • Loading branch information
odscjames committed Feb 17, 2020
1 parent c134dce commit dc2fdde
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ NOTE: This is not in full working order and needs tweaks! See pull request.
vagrant up
vagrant ssh
cd /vagrant
source .ve/bin/activate
python3 ocds-doc-search-cli.py -u http://localhost:6060/ # this indexes to elasticsearch
python3 manage.py runserver 0.0.0.0:5000

Expand Down
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Vagrant.configure(2) do |config|

config.vm.box = "ubuntu/xenial64"
config.vm.box = "ubuntu/bionic64"

config.vm.network "forwarded_port", guest: 9200, host: 9200
config.vm.network "forwarded_port", guest: 6060, host: 6060
Expand Down
24 changes: 16 additions & 8 deletions vagrant/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ set -e
apt-get update
apt-get install -y apt-transport-https openjdk-8-jre python3-pip apache2

pip3 install virtualenv

# Add Elasticsearch repo and install
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add -

Expand All @@ -20,16 +22,22 @@ echo "network.host: 0.0.0.0" >> /etc/elasticsearch/elasticsearch.yml

systemctl enable elasticsearch

# Install Python Libs
pip3 install -r /vagrant/requirements.txt
pip3 install flake8

# Install standard docs
git clone https://github.com/open-contracting/standard.git
cd standard
# Install Virtenv and Python Libs
cd /vagrant
virtualenv .ve -p python3
source .ve/bin/activate
pip3 install -r /vagrant/requirements_dev.txt
deactivate

# Install standard docs (using virtualenv)
git clone https://github.com/open-contracting/standard.git /home/vagrant/standard
cd /home/vagrant/standard
virtualenv .ve -p python3
source .ve/bin/activate
pip3 install -r requirements.txt
sed -i 's/www.standard-search.default.opendataservices.uk0.bigv.io/localhost:5000/g' src/standard-theme/standard_theme/static/js/search.js
sed -i 's/standard-search.open-contracting.org/localhost:5000/g' .ve/src/standard-theme/standard_theme/static/js/search.js
make
deactivate

# Configure Apache
cp /vagrant/vagrant/apache.conf /etc/apache2/sites-enabled/000-default.conf
Expand Down

0 comments on commit dc2fdde

Please sign in to comment.