-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to Packer 0.10.0+ and convert shell scripts to ansible playboo…
…ks (closes #52)
- Loading branch information
1 parent
2a64f05
commit a75b844
Showing
104 changed files
with
963 additions
and
511 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,20 @@ | ||
--- | ||
sudo: required | ||
language: bash | ||
|
||
services: | ||
- postgresql | ||
|
||
## Mimics the Packerfile.json steps | ||
|
||
before_install: | ||
- sudo apt-get update -qq | ||
|
||
install: | ||
- sudo pip install setuptools | ||
- sudo pip install ansible | ||
|
||
before_script: | ||
- sudo adduser ubuntu --disabled-password --gecos "" | ||
- sudo passwd -d ubuntu | ||
- sudo ./scripts/1_setup_dirs_pipes.sh | ||
- sudo cp -rf ./resources/elasticsearch /home/ubuntu/snowplow | ||
- sudo ./scripts/3_setup_apps.sh | ||
- sudo cp -rf ./resources/configs /home/ubuntu/snowplow | ||
- sudo cp -rf ./scripts /home/ubuntu/snowplow | ||
- sudo cp -rf ./resources/init /home/ubuntu/snowplow | ||
- sudo ./scripts/5_setup_init.sh | ||
- sudo ./scripts/6_configure.sh | ||
- ansible-playbook -i provisioning/inventory provisioning/with_building_ui.yml --connection=local --sudo | ||
|
||
script: | ||
- ./integration/integration_test.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1,30 @@ | ||
{ | ||
"variables": { | ||
"version": "0.3.0-RC" | ||
}, | ||
|
||
"builders": [ | ||
{ | ||
"type": "amazon-ebs", | ||
"region": "us-east-1", | ||
"source_ami": "ami-05dddc6f", | ||
"instance_type": "t2.small", | ||
"ssh_username": "ubuntu", | ||
"ami_name": "snowplow-mini-0.2.2-{{ timestamp }}-hvm-ebs-amd64", | ||
"ami_name": "snowplow-mini-{{user `version`}}-{{ timestamp }}-hvm-ebs-amd64", | ||
"ami_groups": [ "all" ], | ||
"ami_regions": "us-east-2,us-west-1,us-west-2,ca-central-1,eu-west-1,eu-central-1,eu-west-2,ap-southeast-1,ap-southeast-2,ap-northeast-2,ap-northeast-1,ap-south-1,sa-east-1", | ||
"ami_description": "Snowplow Mini - The Snowplow Pipeline in a box", | ||
"tags": { | ||
"OS_Version": "Ubuntu-12.04", | ||
"Release": "0.2.2" | ||
"OS_Version": "Ubuntu-14.04", | ||
"Release": "{{user `version`}}" | ||
} | ||
} | ||
], | ||
|
||
"provisioners": [ | ||
{ | ||
"type": "shell", | ||
"script": "scripts/1_setup_dirs_pipes.sh", | ||
"execute_command": "chmod +x {{ .Path }}; sh '{{ .Path }}'" | ||
}, | ||
{ | ||
"type": "file", | ||
"source": "resources/elasticsearch", | ||
"destination": "/home/ubuntu/snowplow" | ||
}, | ||
{ | ||
"type": "shell", | ||
"script": "scripts/2_setup_postgres.sh", | ||
"execute_command": "chmod +x {{ .Path }}; sh '{{ .Path }}'" | ||
}, | ||
{ | ||
"type": "shell", | ||
"script": "scripts/3_setup_apps.sh", | ||
"execute_command": "chmod +x {{ .Path }}; sh '{{ .Path }}'" | ||
}, | ||
{ | ||
"type": "file", | ||
"source": "resources/configs", | ||
"destination": "/home/ubuntu/snowplow" | ||
}, | ||
{ | ||
"type": "file", | ||
"source": "scripts", | ||
"destination": "/home/ubuntu/snowplow" | ||
}, | ||
{ | ||
"type": "file", | ||
"source": "resources/init", | ||
"destination": "/home/ubuntu/snowplow" | ||
}, | ||
{ | ||
"type": "file", | ||
"source": "ui/index.html", | ||
"destination": "/home/ubuntu/snowplow/ui/index.html" | ||
}, | ||
{ | ||
"type": "file", | ||
"source": "ui/dist/snowplow-mini.js", | ||
"destination": "/home/ubuntu/snowplow/ui/dist/snowplow-mini.js" | ||
}, | ||
{ | ||
"type": "file", | ||
"source": "ui/assets", | ||
"destination": "/home/ubuntu/snowplow/ui" | ||
}, | ||
{ | ||
"type": "file", | ||
"source": "ui/node_modules", | ||
"destination": "/home/ubuntu/snowplow/ui" | ||
}, | ||
{ | ||
"type": "shell", | ||
"script": "scripts/4_setup_ui.sh", | ||
"execute_command": "chmod +x {{ .Path }}; sh '{{ .Path }}'" | ||
}, | ||
{ | ||
"type": "shell", | ||
"script": "scripts/5_setup_init.sh", | ||
"execute_command": "chmod +x {{ .Path }}; sh '{{ .Path }}'" | ||
}, | ||
{ | ||
"type": "shell", | ||
"script": "scripts/6_configure.sh", | ||
"execute_command": "chmod +x {{ .Path }}; sh '{{ .Path }}'" | ||
"type": "ansible", | ||
"playbook_file": "provisioning/without_building_ui.yml" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
[vagrant] | ||
127.0.0.1:2222 | ||
[localhost] | ||
127.0.0.1:22 |
18 changes: 18 additions & 0 deletions
18
provisioning/resources/configs/enrichments/campaign_attribution.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"schema": "iglu:com.snowplowanalytics.snowplow/campaign_attribution/jsonschema/1-0-1", | ||
"data": { | ||
"name": "campaign_attribution", | ||
"vendor": "com.snowplowanalytics.snowplow", | ||
"enabled": true, | ||
"parameters": { | ||
"mapping": "static", | ||
"fields": { | ||
"mktMedium": ["utm_medium"], | ||
"mktSource": ["utm_source"], | ||
"mktTerm": ["utm_term"], | ||
"mktContent": ["utm_content"], | ||
"mktCampaign": ["utm_campaign"] | ||
} | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
provisioning/resources/configs/enrichments/event_fingerprint_config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"schema": "iglu:com.snowplowanalytics.snowplow/event_fingerprint_config/jsonschema/1-0-0", | ||
"data": { | ||
"name": "event_fingerprint_config", | ||
"vendor": "com.snowplowanalytics.snowplow", | ||
"enabled": true, | ||
"parameters": { | ||
"excludeParameters": ["eid", "stm"], | ||
"hashAlgorithm": "MD5" | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
provisioning/resources/configs/enrichments/ip_lookups.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"schema": "iglu:com.snowplowanalytics.snowplow/ip_lookups/jsonschema/1-0-0", | ||
"data": { | ||
"name": "ip_lookups", | ||
"vendor": "com.snowplowanalytics.snowplow", | ||
"enabled": true, | ||
"parameters": { | ||
"geo": { | ||
"database": "GeoLiteCity.dat", | ||
"uri": "http://s3-eu-west-1.amazonaws.com/snowplow-hosted-assets/third-party/maxmind" | ||
} | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
provisioning/resources/configs/enrichments/referer_parser.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"schema": "iglu:com.snowplowanalytics.snowplow/referer_parser/jsonschema/1-0-0", | ||
"data": { | ||
"name": "referer_parser", | ||
"vendor": "com.snowplowanalytics.snowplow", | ||
"enabled": true, | ||
"parameters": { | ||
"internalDomains": [ | ||
] | ||
} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
provisioning/resources/configs/enrichments/ua_parser_config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"schema": "iglu:com.snowplowanalytics.snowplow/ua_parser_config/jsonschema/1-0-0", | ||
"data": { | ||
"vendor": "com.snowplowanalytics.snowplow", | ||
"name": "ua_parser_config", | ||
"enabled": true, | ||
"parameters": {} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
provisioning/resources/configs/enrichments/user_agent_utils_config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"schema": "iglu:com.snowplowanalytics.snowplow/user_agent_utils_config/jsonschema/1-0-0", | ||
"data": { | ||
"vendor": "com.snowplowanalytics.snowplow", | ||
"name": "user_agent_utils_config", | ||
"enabled": true, | ||
"parameters": {} | ||
} | ||
} |
64 changes: 32 additions & 32 deletions
64
resources/configs/iglu-resolver.json → ...ning/resources/configs/iglu-resolver.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,32 @@ | ||
{ | ||
"schema": "iglu:com.snowplowanalytics.iglu/resolver-config/jsonschema/1-0-0", | ||
"data": { | ||
"cacheSize": 500, | ||
"repositories": [ | ||
{ | ||
"name": "Iglu Central", | ||
"priority": 1, | ||
"vendorPrefixes": [ | ||
"com.snowplowanalytics" | ||
], | ||
"connection": { | ||
"http": { | ||
"uri": "http://iglucentral.com" | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "Iglu Server", | ||
"priority": 0, | ||
"vendorPrefixes": [ | ||
"com.snowplowanalytics" | ||
], | ||
"connection": { | ||
"http": { | ||
"uri": "http://localhost:8081/api" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
{ | ||
"schema": "iglu:com.snowplowanalytics.iglu/resolver-config/jsonschema/1-0-0", | ||
"data": { | ||
"cacheSize": 500, | ||
"repositories": [ | ||
{ | ||
"name": "Iglu Central", | ||
"priority": 1, | ||
"vendorPrefixes": [ | ||
"com.snowplowanalytics" | ||
], | ||
"connection": { | ||
"http": { | ||
"uri": "http://iglucentral.com" | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "Iglu Server", | ||
"priority": 0, | ||
"vendorPrefixes": [ | ||
"com.snowplowanalytics" | ||
], | ||
"connection": { | ||
"http": { | ||
"uri": "http://localhost:8081/api" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
resources/configs/snowplow-mini.conf → ...ning/resources/configs/snowplow-mini.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
- name: Update apt cache | ||
apt: update-cache=yes cache_valid_time=86400 | ||
sudo: yes | ||
|
||
- name: install basic packages | ||
sudo: yes | ||
apt: pkg={{ item }} state=latest | ||
tags: [packages] | ||
with_items: | ||
- curl | ||
- unzip | ||
|
||
- name: Add Google DNS nameserver | ||
lineinfile: | ||
dest="/etc/resolvconf/resolv.conf.d/base" | ||
line="nameserver 8.8.8.8" | ||
sudo: yes | ||
|
||
- name: Update nameserver list | ||
command: "resolvconf -u" | ||
sudo: yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
main_dir: "/home/ubuntu/snowplow" | ||
configs_dir: "{{main_dir}}/configs" | ||
staging_dir: "{{main_dir}}/staging" | ||
executables_dir: "{{main_dir}}/bin" | ||
unix_pipes_dir: "{{main_dir}}/pipes" | ||
es_dir: "{{main_dir}}/elasticsearch" | ||
scripts_dir: "{{main_dir}}/scripts" | ||
init_dir: "{{main_dir}}/init" | ||
ui_dir: "{{main_dir}}/ui/dist" | ||
ansible_cache_dir: "/var/cache/ansible" | ||
software_install_dir: "/usr/local/share" | ||
user_binaries: "/usr/local/bin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.retry | ||
tests/test.sh |
Oops, something went wrong.