-
Notifications
You must be signed in to change notification settings - Fork 1
/
Vagrantfile
68 lines (55 loc) · 3.03 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
#
# Note:
# edit /etc/apt/sources.list to uncomment the following
# deb http://security.ubuntu.com/ubuntu trusty-security multiverse
# deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
# Change this to be something relevant to your project
config.vm.hostname = "city-scrape"
config.vm.provision :shell, inline: "apt-get -y install --fix-missing"
config.vm.provision :shell, inline: "apt-get -y install python"
config.vm.provision :shell, inline: "apt-get -y install python-dev"
config.vm.provision :shell, inline: "apt-get -y install python-setuptools"
config.vm.provision :shell, inline: "apt-get -y install python-pip"
config.vm.provision :shell, inline: "apt-get -y install zip unzip"
config.vm.provision :shell, inline: "apt-get -y install libssl-dev"
config.vm.provision :shell, inline: "apt-get -y install libcurl4-openssl-dev"
config.vm.provision :shell, inline: "apt-get -y install libpq-dev"
config.vm.provision :shell, inline: "apt-get -y install postgresql"
config.vm.provision :shell, inline: "apt-get -y install postgresql-contrib"
config.vm.provision :shell, inline: "sudo -i -u postgres"
# Copy dotfiles out of host homedir when they exist
# Do not copy things like .bashrc since there are often many lines of code there that do not run
# May cause problems
dotfiles = %w{ bash_aliases }
dotfiles.each do |dotfile|
dotfile_full = File.expand_path("~/.#{dotfile}")
puts "Copying #{dotfile_full}"
if File.exists?(dotfile_full)
config.vm.provision "file", source: dotfile_full, destination: "/home/vagrant/.#{dotfile}"
end
end
# Copy over your personal SSH keys
config.vm.provision "file", source: "~/.ssh/id_rsa", destination: "/home/vagrant/.ssh/id_rsa"
config.vm.provision "file", source: "~/.ssh/id_rsa.pub", destination: "/home/vagrant/.ssh/id_rsa.pub"
# Port Forwarding
# Forward the ports that you need to use here
config.vm.network "forwarded_port", host: 8000, guest: 8000, auto_correct: true
# This line will cause a warning `stdin: is not a tty` but googling says to ignore it
# Refer to the startup script itself for more comments
config.vm.provision "shell", inline: "echo '. /vagrant/vagrant-startup.sh' >> /home/vagrant/.bashrc"
# Install Docker
config.vm.provision :shell, inline: "wget -qO- https://get.docker.com/ | sh"
config.vm.provision :shell, inline: "apt-get -y update"
config.vm.provision :shell, inline: "usermod -aG docker vagrant"
# Install and Setup Gdal
config.vm.provision :shell, inline: "add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable"
config.vm.provision :shell, inline: "apt-get -y update"
config.vm.provision :shell, inline: "apt-get -y install gdal-bin"
config.vm.provision :shell, inline: "echo `ogrinfo`"
# Install and setup mdbtools
config.vm.provision :shell, inline: "apt-get -y install mdbtools"
end