Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Vagrant #15

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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