Skip to content
This repository has been archived by the owner on Oct 17, 2023. It is now read-only.

Commit

Permalink
Have the Vagrant provision get some CSV files.
Browse files Browse the repository at this point in the history
  • Loading branch information
oalders committed Sep 23, 2015
1 parent 408f229 commit 552973f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,4 +1,5 @@
cpanfile.snapshot
*.csv
example.mmdb
local
*.mmdb
Expand Down
11 changes: 9 additions & 2 deletions Vagrantfile
Expand Up @@ -77,17 +77,24 @@ Vagrant.configure(2) do |config|
sudo rm -f /etc/GeoIP.conf
# 'make' is part of build-essential
sudo aptitude install -y build-essential curl libmaxminddb0 libmaxminddb-dev mmdb-bin
sudo aptitude install -y build-essential curl libmaxminddb0 libmaxminddb-dev mmdb-bin unzip
sudo aptitude install -y geoipupdate
# install cpanm
curl -L https://cpanmin.us | perl - App::cpanminus
# install Perl modules from CPAN
cpanm --notest Devel::Refcount MaxMind::DB::Reader::XS MaxMind::DB::Writer::Tree Net::Works::Network GeoIP2 Data::Printer
cpanm --notest Devel::Refcount MaxMind::DB::Reader::XS MaxMind::DB::Writer::Tree Net::Works::Network GeoIP2 Data::Printer Text::CSV_XS
sudo cp /vagrant/GeoIP.conf /etc/GeoIP.conf
sudo geoipupdate
rm -rf /tmp/csv
mkdir /tmp/csv
curl https://geolite.maxmind.com/download/geoip/database/GeoLite2-City-CSV.zip > /tmp/csv/GeoLite2-City-CSV.zip
unzip -o /tmp/GeoLite2-City-CSV.zip -d /tmp/csv/
find /tmp/csv/ -name GeoLite2-City-Locations-en.csv | xargs -I '{}' mv '{}' /vagrant/
find /tmp/csv/ -name GeoLite2-City-Blocks-IPv4.csv | xargs -I '{}' mv '{}' /vagrant/
SHELL
end

0 comments on commit 552973f

Please sign in to comment.