Skip to content

Commit

Permalink
Added dedicated Vagrant setup (closes #92)
Browse files Browse the repository at this point in the history
Added Turkish popular traffic provider platforms, thanks @cagataygurturk!
Now building referer-parser against Java 6, not 7 (closes #84)
  • Loading branch information
alexanderdean committed Feb 1, 2015
1 parent 88c7ff7 commit dbc3cec
Show file tree
Hide file tree
Showing 10 changed files with 106 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/vendor/
/composer.lock
php/.idea

# Ruby
ruby/.idea/.name
ruby/.idea/.rakeTasks
ruby/.idea/encodings.xml
Expand All @@ -10,3 +12,6 @@ ruby/.idea/ruby.iml
ruby/.idea/scopes/scope_settings.xml
ruby/.idea/vcs.xml
ruby/.idea/workspace.xml

# Vagrant
.vagrant
19 changes: 19 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Vagrant.configure("2") do |config|

config.vm.box = "ubuntu/trusty64"
config.vm.hostname = "referer-parser"
config.ssh.forward_agent = true

config.vm.provider :virtualbox do |vb|
vb.name = Dir.pwd().split("/")[-1] + "-" + Time.now.to_f.to_i.to_s
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
vb.customize [ "guestproperty", "set", :id, "--timesync-threshold", 10000 ]
# Scala is our most memory-hungry library
vb.memory = 5120
end

config.vm.provision :shell do |sh|
sh.path = "vagrant/up.bash"
end

end
6 changes: 6 additions & 0 deletions java-scala/CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version 0.2.3 (2014-02-01)
--------------------------
Added dedicated Vagrant setup (#92)
Added Turkish popular traffic provider platforms, thanks @cagataygurturk!
Now building referer-parser against Java 6, not 7 (#84)

Version 0.2.2 (2014-07-23)
--------------------------
Fixed Java referer-parser doesn't work on Hadoop (#76)
Expand Down
2 changes: 1 addition & 1 deletion java-scala/project/BuildSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ object BuildSettings {
// Basic settings for our app
lazy val basicSettings = Seq[Setting[_]](
organization := "com.snowplowanalytics",
version := "0.2.2",
version := "0.2.3",
description := "Library for extracting marketing attribution data from referer URLs",
scalaVersion := "2.9.1",
crossScalaVersions := Seq("2.9.1", "2.10.4", "2.11.1"),
Expand Down
3 changes: 3 additions & 0 deletions vagrant/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.peru
oss-playbooks
ansible
2 changes: 2 additions & 0 deletions vagrant/ansible.hosts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[vagrant]
127.0.0.1:2222
14 changes: 14 additions & 0 deletions vagrant/peru.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
imports:
ansible: ansible
ansible_playbooks: oss-playbooks

curl module ansible:
# Equivalent of git cloning tags/v1.6.6 but much, much faster
url: https://codeload.github.com/ansible/ansible/zip/69d85c22c7475ccf8169b6ec9dee3ee28c92a314
build: unzip ansible-69d85c22c7475ccf8169b6ec9dee3ee28c92a314.zip
export: ansible-69d85c22c7475ccf8169b6ec9dee3ee28c92a314

git module ansible_playbooks:
url: https://github.com/snowplow/ansible-playbooks.git
# Comment out to fetch a specific rev instead of master:
# rev: xxx
50 changes: 50 additions & 0 deletions vagrant/up.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash
set -e

vagrant_dir=/vagrant/vagrant
bashrc=/home/vagrant/.bashrc

echo "========================================"
echo "INSTALLING PERU AND ANSIBLE DEPENDENCIES"
echo "----------------------------------------"
apt-get update
apt-get install -y language-pack-en git unzip libyaml-dev python3-pip python-yaml python-paramiko python-jinja2

echo "==============="
echo "INSTALLING PERU"
echo "---------------"
sudo pip3 install peru

echo "======================================="
echo "CLONING ANSIBLE AND PLAYBOOKS WITH PERU"
echo "---------------------------------------"
cd ${vagrant_dir} && peru sync -v
echo "... done"

env_setup=${vagrant_dir}/ansible/hacking/env-setup
hosts=${vagrant_dir}/ansible.hosts

echo "==================="
echo "CONFIGURING ANSIBLE"
echo "-------------------"
touch ${bashrc}
echo "source ${env_setup}" >> ${bashrc}
echo "export ANSIBLE_HOSTS=${hosts}" >> ${bashrc}
echo "... done"

echo "=========================================="
echo "RUNNING PLAYBOOKS WITH ANSIBLE*"
echo "* no output while each playbook is running"
echo "------------------------------------------"
while read pb; do
su - -c "source ${env_setup} && ${vagrant_dir}/ansible/bin/ansible-playbook ${vagrant_dir}/${pb} --connection=local --inventory-file=${hosts}" vagrant
done <${vagrant_dir}/up.playbooks

guidance=${vagrant_dir}/up.guidance

if [ -f ${guidance} ]; then
echo "==========="
echo "PLEASE READ"
echo "-----------"
cat $guidance
fi
3 changes: 3 additions & 0 deletions vagrant/up.guidance
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
To get started:
vagrant ssh
cd /vagrant
3 changes: 3 additions & 0 deletions vagrant/up.playbooks
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
oss-playbooks/java6.yml
oss-playbooks/scala.yml
oss-playbooks/sbt.yml

0 comments on commit dbc3cec

Please sign in to comment.