forked from FAIRDataPipeline/data-registry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
48 lines (34 loc) · 1.16 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# -*- mode: ruby -*-
# vi: set ft=ruby :
#
# A VM can be created using the command "vagrant up"
#
# This will make a local version of the registry running in a VM.
# You can connect to the registry via http://192.168.20.10:8000
#
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-18.04"
# sync folder containing data registry code
config.vm.synced_folder ".", "/code/data-registry"
config.vm.network "private_network", ip: "192.168.20.10"
config.vm.network "forwarded_port", guest: 8000, host: 8000
config.vm.provision :shell, inline: <<SHELL
set -x
mkdir -p /root/.ssh
cp ~vagrant/.ssh/authorized_keys /root/.ssh
apt-get update -y
apt-get install -y python3-venv graphviz
export FAIR_HOME=/code/data-registry
rm -rf "$FAIR_HOME"/venv
python3 -m venv "$FAIR_HOME"/venv
source "$FAIR_HOME"/venv/bin/activate
python -m pip install --upgrade pip wheel
python -m pip install -r "$FAIR_HOME"/local-requirements.txt
export DJANGO_SETTINGS_MODULE="drams.vagrant-settings"
export DJANGO_SUPERUSER_USERNAME=admin
export DJANGO_SUPERUSER_PASSWORD=admin
cd "$FAIR_HOME"/scripts || exit
./rebuild-local.sh
./start_fair_registry_vagrant
SHELL
end