Skip to content

Commit dbc3cec

Browse files
committed
Added dedicated Vagrant setup (closes #92)
Added Turkish popular traffic provider platforms, thanks @cagataygurturk! Now building referer-parser against Java 6, not 7 (closes #84)
1 parent 88c7ff7 commit dbc3cec

File tree

10 files changed

+106
-1
lines changed

10 files changed

+106
-1
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/vendor/
22
/composer.lock
33
php/.idea
4+
5+
# Ruby
46
ruby/.idea/.name
57
ruby/.idea/.rakeTasks
68
ruby/.idea/encodings.xml
@@ -10,3 +12,6 @@ ruby/.idea/ruby.iml
1012
ruby/.idea/scopes/scope_settings.xml
1113
ruby/.idea/vcs.xml
1214
ruby/.idea/workspace.xml
15+
16+
# Vagrant
17+
.vagrant

Vagrantfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Vagrant.configure("2") do |config|
2+
3+
config.vm.box = "ubuntu/trusty64"
4+
config.vm.hostname = "referer-parser"
5+
config.ssh.forward_agent = true
6+
7+
config.vm.provider :virtualbox do |vb|
8+
vb.name = Dir.pwd().split("/")[-1] + "-" + Time.now.to_f.to_i.to_s
9+
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
10+
vb.customize [ "guestproperty", "set", :id, "--timesync-threshold", 10000 ]
11+
# Scala is our most memory-hungry library
12+
vb.memory = 5120
13+
end
14+
15+
config.vm.provision :shell do |sh|
16+
sh.path = "vagrant/up.bash"
17+
end
18+
19+
end

java-scala/CHANGELOG

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Version 0.2.3 (2014-02-01)
2+
--------------------------
3+
Added dedicated Vagrant setup (#92)
4+
Added Turkish popular traffic provider platforms, thanks @cagataygurturk!
5+
Now building referer-parser against Java 6, not 7 (#84)
6+
17
Version 0.2.2 (2014-07-23)
28
--------------------------
39
Fixed Java referer-parser doesn't work on Hadoop (#76)

java-scala/project/BuildSettings.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ object BuildSettings {
2222
// Basic settings for our app
2323
lazy val basicSettings = Seq[Setting[_]](
2424
organization := "com.snowplowanalytics",
25-
version := "0.2.2",
25+
version := "0.2.3",
2626
description := "Library for extracting marketing attribution data from referer URLs",
2727
scalaVersion := "2.9.1",
2828
crossScalaVersions := Seq("2.9.1", "2.10.4", "2.11.1"),

vagrant/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.peru
2+
oss-playbooks
3+
ansible

vagrant/ansible.hosts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[vagrant]
2+
127.0.0.1:2222

vagrant/peru.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
imports:
2+
ansible: ansible
3+
ansible_playbooks: oss-playbooks
4+
5+
curl module ansible:
6+
# Equivalent of git cloning tags/v1.6.6 but much, much faster
7+
url: https://codeload.github.com/ansible/ansible/zip/69d85c22c7475ccf8169b6ec9dee3ee28c92a314
8+
build: unzip ansible-69d85c22c7475ccf8169b6ec9dee3ee28c92a314.zip
9+
export: ansible-69d85c22c7475ccf8169b6ec9dee3ee28c92a314
10+
11+
git module ansible_playbooks:
12+
url: https://github.com/snowplow/ansible-playbooks.git
13+
# Comment out to fetch a specific rev instead of master:
14+
# rev: xxx

vagrant/up.bash

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/bin/bash
2+
set -e
3+
4+
vagrant_dir=/vagrant/vagrant
5+
bashrc=/home/vagrant/.bashrc
6+
7+
echo "========================================"
8+
echo "INSTALLING PERU AND ANSIBLE DEPENDENCIES"
9+
echo "----------------------------------------"
10+
apt-get update
11+
apt-get install -y language-pack-en git unzip libyaml-dev python3-pip python-yaml python-paramiko python-jinja2
12+
13+
echo "==============="
14+
echo "INSTALLING PERU"
15+
echo "---------------"
16+
sudo pip3 install peru
17+
18+
echo "======================================="
19+
echo "CLONING ANSIBLE AND PLAYBOOKS WITH PERU"
20+
echo "---------------------------------------"
21+
cd ${vagrant_dir} && peru sync -v
22+
echo "... done"
23+
24+
env_setup=${vagrant_dir}/ansible/hacking/env-setup
25+
hosts=${vagrant_dir}/ansible.hosts
26+
27+
echo "==================="
28+
echo "CONFIGURING ANSIBLE"
29+
echo "-------------------"
30+
touch ${bashrc}
31+
echo "source ${env_setup}" >> ${bashrc}
32+
echo "export ANSIBLE_HOSTS=${hosts}" >> ${bashrc}
33+
echo "... done"
34+
35+
echo "=========================================="
36+
echo "RUNNING PLAYBOOKS WITH ANSIBLE*"
37+
echo "* no output while each playbook is running"
38+
echo "------------------------------------------"
39+
while read pb; do
40+
su - -c "source ${env_setup} && ${vagrant_dir}/ansible/bin/ansible-playbook ${vagrant_dir}/${pb} --connection=local --inventory-file=${hosts}" vagrant
41+
done <${vagrant_dir}/up.playbooks
42+
43+
guidance=${vagrant_dir}/up.guidance
44+
45+
if [ -f ${guidance} ]; then
46+
echo "==========="
47+
echo "PLEASE READ"
48+
echo "-----------"
49+
cat $guidance
50+
fi

vagrant/up.guidance

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
To get started:
2+
vagrant ssh
3+
cd /vagrant

vagrant/up.playbooks

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
oss-playbooks/java6.yml
2+
oss-playbooks/scala.yml
3+
oss-playbooks/sbt.yml

0 commit comments

Comments
 (0)