sluice-jason 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.coveralls.yml +1 -0
- data/.gitignore +20 -0
- data/.travis.yml +10 -0
- data/CHANGELOG +94 -0
- data/Gemfile +4 -0
- data/Guardfile +11 -0
- data/LICENSE-2.0.txt +202 -0
- data/README.md +83 -0
- data/Vagrantfile +23 -0
- data/lib/sluice/errors.rb +26 -0
- data/lib/sluice/storage/s3/contracts.rb +32 -0
- data/lib/sluice/storage/s3/location.rb +77 -0
- data/lib/sluice/storage/s3/manifest.rb +129 -0
- data/lib/sluice/storage/s3/s3.rb +704 -0
- data/lib/sluice/storage/storage.rb +111 -0
- data/lib/sluice/version.rb +19 -0
- data/lib/sluice.rb +21 -0
- data/sluice.gemspec +46 -0
- data/spec/spec_helper.rb +4 -0
- data/spec/storage/s3/location_spec.rb +47 -0
- data/spec/storage/s3/s3_spec.rb +42 -0
- data/vagrant/.gitignore +3 -0
- data/vagrant/ansible.hosts +2 -0
- data/vagrant/peru.yaml +14 -0
- data/vagrant/push.bash +79 -0
- data/vagrant/up.bash +50 -0
- data/vagrant/up.guidance +5 -0
- data/vagrant/up.playbooks +1 -0
- metadata +180 -0
@@ -0,0 +1,111 @@
|
|
1
|
+
# Copyright (c) 2012-2014 Snowplow Analytics Ltd. All rights reserved.
|
2
|
+
#
|
3
|
+
# This program is licensed to you under the Apache License Version 2.0,
|
4
|
+
# and you may not use this file except in compliance with the Apache License Version 2.0.
|
5
|
+
# You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
|
6
|
+
#
|
7
|
+
# Unless required by applicable law or agreed to in writing,
|
8
|
+
# software distributed under the Apache License Version 2.0 is distributed on an
|
9
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
10
|
+
# See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
|
11
|
+
|
12
|
+
# Author:: Alex Dean (mailto:support@snowplowanalytics.com), Michael Tibben
|
13
|
+
# Copyright:: Copyright (c) 2012-2014 Snowplow Analytics Ltd
|
14
|
+
# License:: Apache License Version 2.0
|
15
|
+
|
16
|
+
module Sluice
|
17
|
+
module Storage
|
18
|
+
|
19
|
+
# To handle negative file matching
|
20
|
+
NegativeRegex = Struct.new(:regex)
|
21
|
+
|
22
|
+
# Find files within the given date range
|
23
|
+
# (inclusive).
|
24
|
+
#
|
25
|
+
# Parameters:
|
26
|
+
# +start_date+:: start date
|
27
|
+
# +end_date+:: end date
|
28
|
+
# +date_format:: format of date in filenames
|
29
|
+
# +file_ext:: extension on files (if any)
|
30
|
+
def files_between(start_date, end_date, date_format, file_ext=nil)
|
31
|
+
|
32
|
+
dates = []
|
33
|
+
Date.parse(start_date).upto(Date.parse(end_date)) do |day|
|
34
|
+
dates << day.strftime(date_format)
|
35
|
+
end
|
36
|
+
|
37
|
+
'(' + dates.join('|') + ')[^/]+%s$' % regexify(file_ext)
|
38
|
+
end
|
39
|
+
module_function :files_between
|
40
|
+
|
41
|
+
# Add a trailing slash to a path if missing.
|
42
|
+
# Tolerates a nil path.
|
43
|
+
#
|
44
|
+
# Parameters:
|
45
|
+
# +path+:: path to add a trailing slash to
|
46
|
+
def trail_slash(path)
|
47
|
+
unless path.nil?
|
48
|
+
path[-1].chr != '/' ? path << '/' : path
|
49
|
+
end
|
50
|
+
end
|
51
|
+
module_function :trail_slash
|
52
|
+
|
53
|
+
# Find files up to (and including) the given date.
|
54
|
+
#
|
55
|
+
# Returns a regex in a NegativeRegex so that the
|
56
|
+
# matcher can negate the match.
|
57
|
+
#
|
58
|
+
# Parameters:
|
59
|
+
# +end_date+:: end date
|
60
|
+
# +date_format:: format of date in filenames
|
61
|
+
# +file_ext:: extension on files (if any)
|
62
|
+
def files_up_to(end_date, date_format, file_ext=nil)
|
63
|
+
|
64
|
+
# Let's create a black list from the day
|
65
|
+
# after the end_date up to today
|
66
|
+
day_after = Date.parse(end_date) + 1
|
67
|
+
today = Date.today
|
68
|
+
|
69
|
+
dates = []
|
70
|
+
day_after.upto(today) do |day|
|
71
|
+
dates << day.strftime(date_format) # Black list
|
72
|
+
end
|
73
|
+
|
74
|
+
NegativeRegex.new('(' + dates.join('|') + ')[^/]+%s$' % regexify(file_ext))
|
75
|
+
end
|
76
|
+
module_function :files_up_to
|
77
|
+
|
78
|
+
# Find files starting from the given date.
|
79
|
+
#
|
80
|
+
# Parameters:
|
81
|
+
# +start_date+:: start date
|
82
|
+
# +date_format:: format of date in filenames
|
83
|
+
# +file_ext:: extension on files (if any); include period
|
84
|
+
def files_from(start_date, date_format, file_ext=nil)
|
85
|
+
|
86
|
+
# Let's create a white list from the start_date to today
|
87
|
+
today = Date.today
|
88
|
+
|
89
|
+
dates = []
|
90
|
+
Date.parse(start_date).upto(today) do |day|
|
91
|
+
dates << day.strftime(date_format)
|
92
|
+
end
|
93
|
+
|
94
|
+
'(' + dates.join('|') + ')[^/]+%s$' % regexify(file_ext)
|
95
|
+
end
|
96
|
+
module_function :files_from
|
97
|
+
|
98
|
+
private
|
99
|
+
|
100
|
+
# Make a file extension regular expression friendly,
|
101
|
+
# adding a starting period (.) if missing
|
102
|
+
#
|
103
|
+
# Parameters:
|
104
|
+
# +file_ext:: the file extension to make regexp friendly
|
105
|
+
def regexify(file_ext)
|
106
|
+
file_ext.nil? ? nil : file_ext[0].chr != '.' ? '\\.' << file_ext : '\\' << file_ext
|
107
|
+
end
|
108
|
+
module_function :regexify
|
109
|
+
|
110
|
+
end
|
111
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# Copyright (c) 2012-2014 Snowplow Analytics Ltd. All rights reserved.
|
2
|
+
#
|
3
|
+
# This program is licensed to you under the Apache License Version 2.0,
|
4
|
+
# and you may not use this file except in compliance with the Apache License Version 2.0.
|
5
|
+
# You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
|
6
|
+
#
|
7
|
+
# Unless required by applicable law or agreed to in writing,
|
8
|
+
# software distributed under the Apache License Version 2.0 is distributed on an
|
9
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
10
|
+
# See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
|
11
|
+
|
12
|
+
# Author:: Alex Dean (mailto:support@snowplowanalytics.com)
|
13
|
+
# Copyright:: Copyright (c) 2012-2014 Snowplow Analytics Ltd
|
14
|
+
# License:: Apache License Version 2.0
|
15
|
+
|
16
|
+
module Sluice
|
17
|
+
NAME = "sluice"
|
18
|
+
VERSION = "0.0.1"
|
19
|
+
end
|
data/lib/sluice.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# Copyright (c) 2012-2014 Snowplow Analytics Ltd. All rights reserved.
|
2
|
+
#
|
3
|
+
# This program is licensed to you under the Apache License Version 2.0,
|
4
|
+
# and you may not use this file except in compliance with the Apache License Version 2.0.
|
5
|
+
# You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
|
6
|
+
#
|
7
|
+
# Unless required by applicable law or agreed to in writing,
|
8
|
+
# software distributed under the Apache License Version 2.0 is distributed on an
|
9
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
10
|
+
# See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
|
11
|
+
|
12
|
+
# Author:: Alex Dean (mailto:support@snowplowanalytics.com)
|
13
|
+
# Copyright:: Copyright (c) 2012-2014 Snowplow Analytics Ltd
|
14
|
+
# License:: Apache License Version 2.0
|
15
|
+
|
16
|
+
require 'sluice/errors'
|
17
|
+
require 'sluice/storage/storage'
|
18
|
+
require 'sluice/storage/s3/contracts'
|
19
|
+
require 'sluice/storage/s3/location'
|
20
|
+
require 'sluice/storage/s3/manifest'
|
21
|
+
require 'sluice/storage/s3/s3'
|
data/sluice.gemspec
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
# Copyright (c) 2012-2014 Snowplow Analytics Ltd. All rights reserved.
|
2
|
+
#
|
3
|
+
# This program is licensed to you under the Apache License Version 2.0,
|
4
|
+
# and you may not use this file except in compliance with the Apache License Version 2.0.
|
5
|
+
# You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
|
6
|
+
#
|
7
|
+
# Unless required by applicable law or agreed to in writing,
|
8
|
+
# software distributed under the Apache License Version 2.0 is distributed on an
|
9
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
10
|
+
# See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
|
11
|
+
|
12
|
+
# Author:: Alex Dean (mailto:support@snowplowanalytics.com)
|
13
|
+
# Copyright:: Copyright (c) 2012-2014 Snowplow Analytics Ltd
|
14
|
+
# License:: Apache License Version 2.0
|
15
|
+
|
16
|
+
# -*- encoding: utf-8 -*-
|
17
|
+
lib = File.expand_path('../lib', __FILE__)
|
18
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
19
|
+
require 'sluice/version'
|
20
|
+
|
21
|
+
Gem::Specification.new do |gem|
|
22
|
+
gem.authors = ["Alex Dean", "Michael Tibben"]
|
23
|
+
gem.email = ["support@snowplowanalytics.com"]
|
24
|
+
gem.summary = %q{Ruby toolkit for cloud-friendly ETL}
|
25
|
+
gem.description = %q{A Ruby gem to help you build ETL processes involving Amazon S3. Uses Fog}
|
26
|
+
gem.homepage = "http://snowplowanalytics.com"
|
27
|
+
|
28
|
+
gem.files = `git ls-files`.split($\)
|
29
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
30
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
31
|
+
gem.name = "sluice-jason"
|
32
|
+
gem.version = Sluice::VERSION
|
33
|
+
gem.license = "Apache-2.0"
|
34
|
+
gem.platform = Gem::Platform::RUBY
|
35
|
+
gem.require_paths = ["lib"]
|
36
|
+
|
37
|
+
# Dependencies
|
38
|
+
gem.add_dependency 'contracts', '~> 0.4'
|
39
|
+
gem.add_dependency 'fog', '1.24'
|
40
|
+
|
41
|
+
gem.add_development_dependency "rspec", "~> 2.14", ">= 2.14.1"
|
42
|
+
gem.add_development_dependency "rspec-nc"
|
43
|
+
gem.add_development_dependency "guard"
|
44
|
+
gem.add_development_dependency "guard-rspec"
|
45
|
+
gem.add_development_dependency "coveralls"
|
46
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
# Copyright (c) 2012-2014 Snowplow Analytics Ltd. All rights reserved.
|
2
|
+
#
|
3
|
+
# This program is licensed to you under the Apache License Version 2.0,
|
4
|
+
# and you may not use this file except in compliance with the Apache License Version 2.0.
|
5
|
+
# You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
|
6
|
+
#
|
7
|
+
# Unless required by applicable law or agreed to in writing,
|
8
|
+
# software distributed under the Apache License Version 2.0 is distributed on an
|
9
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
10
|
+
# See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
|
11
|
+
|
12
|
+
# Authors:: Alex Dean (mailto:support@snowplowanalytics.com), Michael Tibben
|
13
|
+
# Copyright:: Copyright (c) 2012-2014 Snowplow Analytics Ltd
|
14
|
+
# License:: Apache License Version 2.0
|
15
|
+
|
16
|
+
require 'spec_helper'
|
17
|
+
|
18
|
+
Location = Sluice::Storage::S3::Location
|
19
|
+
|
20
|
+
describe Location do
|
21
|
+
|
22
|
+
it 'should successfully initialize with a valid S3 (s3://) bucket' do
|
23
|
+
loc = Location.new('s3://my-s3-bucket/')
|
24
|
+
loc.bucket.should eql 'my-s3-bucket'
|
25
|
+
loc.dir.should eql ''
|
26
|
+
loc.dir_as_path.should eql ''
|
27
|
+
loc.to_s.should eql 's3://my-s3-bucket/'
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'should successfully initialize with a valid S3 (s3n://) bucket' do
|
31
|
+
loc = Location.new('s3n://my-s3n-bucket/')
|
32
|
+
loc.bucket.should eql 'my-s3n-bucket'
|
33
|
+
loc.dir.should eql ''
|
34
|
+
loc.dir_as_path.should eql ''
|
35
|
+
loc.to_s.should eql 's3n://my-s3n-bucket/'
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'should support object equality tests' do
|
39
|
+
loc1 = Location.new('s3n://my-s3n-bucket/hello/blah/')
|
40
|
+
loc2 = Location.new('s3n://my-s3n-bucket/hello/blah/')
|
41
|
+
loc1.should eql loc2
|
42
|
+
loc2.should eql loc1
|
43
|
+
loc1.should == loc2
|
44
|
+
loc2.should == loc1
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# Copyright (c) 2012-2014 Snowplow Analytics Ltd. All rights reserved.
|
2
|
+
#
|
3
|
+
# This program is licensed to you under the Apache License Version 2.0,
|
4
|
+
# and you may not use this file except in compliance with the Apache License Version 2.0.
|
5
|
+
# You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
|
6
|
+
#
|
7
|
+
# Unless required by applicable law or agreed to in writing,
|
8
|
+
# software distributed under the Apache License Version 2.0 is distributed on an
|
9
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
10
|
+
# See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
|
11
|
+
|
12
|
+
# Authors:: Alex Dean (mailto:support@snowplowanalytics.com), Michael Tibben
|
13
|
+
# Copyright:: Copyright (c) 2012-2014 Snowplow Analytics Ltd
|
14
|
+
# License:: Apache License Version 2.0
|
15
|
+
|
16
|
+
require 'spec_helper'
|
17
|
+
|
18
|
+
S3 = Sluice::Storage::S3
|
19
|
+
|
20
|
+
describe S3 do
|
21
|
+
|
22
|
+
it 'should allow filenames to be renamed' do
|
23
|
+
|
24
|
+
concat_subdir = lambda { |basename, filepath|
|
25
|
+
if m = filepath.match('([^/]+)/[^/]+$')
|
26
|
+
return m[1] + '-' + basename
|
27
|
+
else
|
28
|
+
return basename
|
29
|
+
end
|
30
|
+
}
|
31
|
+
|
32
|
+
foobar = lambda {
|
33
|
+
'foobar'
|
34
|
+
}
|
35
|
+
|
36
|
+
S3.rename_file('/dir/subdir/file', 'file', lambda=false).should eql 'file'
|
37
|
+
S3.rename_file('/dir/subdir/file', nil, foobar).should eql 'foobar'
|
38
|
+
S3.rename_file('resources/environments/logs/publish/e-bgp9nsynv7/i-f2b831bd/_var_log_tomcat7_localhost_access_log.txt-1391958061.gz', '_var_log_tomcat7_localhost_access_log.txt-1391958061.gz', concat_subdir).should eql 'i-f2b831bd-_var_log_tomcat7_localhost_access_log.txt-1391958061.gz'
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
data/vagrant/.gitignore
ADDED
data/vagrant/peru.yaml
ADDED
@@ -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
|
+
unpack: 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
|
data/vagrant/push.bash
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
set -e
|
3
|
+
|
4
|
+
# Constants
|
5
|
+
rubygems_user=snowplow
|
6
|
+
rubygems_gem=sluice
|
7
|
+
|
8
|
+
# Check if our Vagrant box is running. Expects `vagrant status` to look like:
|
9
|
+
#
|
10
|
+
# > Current machine states:
|
11
|
+
# >
|
12
|
+
# > default poweroff (virtualbox)
|
13
|
+
# >
|
14
|
+
# > The VM is powered off. To restart the VM, simply run `vagrant up`
|
15
|
+
function running {
|
16
|
+
set +e
|
17
|
+
vagrant status | sed -n 3p | grep -q "^default\s*running (virtualbox)$"
|
18
|
+
local is_running=$?
|
19
|
+
set -e
|
20
|
+
echo $is_running
|
21
|
+
}
|
22
|
+
|
23
|
+
# Reads the version out of the version.rb
|
24
|
+
function parse_version {
|
25
|
+
cat "lib/${rubygems_gem}/version.rb" | awk '/ VERSION =/ {v=$3; gsub(/\047/, "", v)} END {print v}'
|
26
|
+
}
|
27
|
+
|
28
|
+
# Installs RubyGems.org credentials in our guest
|
29
|
+
#
|
30
|
+
# Parameters:
|
31
|
+
# 1. rubygems_password
|
32
|
+
function install_creds {
|
33
|
+
vagrant ssh -c "curl -u ${rubygems_user}:${1} https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials"
|
34
|
+
vagrant ssh -c "chmod 0600 ~/.gem/credentials"
|
35
|
+
}
|
36
|
+
|
37
|
+
# Builds our gem
|
38
|
+
function build_gem {
|
39
|
+
vagrant ssh -c "cd /vagrant && gem build ${rubygems_gem}.gemspec"
|
40
|
+
}
|
41
|
+
|
42
|
+
# Installs our gem
|
43
|
+
#
|
44
|
+
# Parameters:
|
45
|
+
# 1. rubygems_version
|
46
|
+
function install_gem {
|
47
|
+
vagrant ssh -c "cd /vagrant && sudo gem install ./${rubygems_gem}-${1}.gem"
|
48
|
+
}
|
49
|
+
|
50
|
+
# Pushes our gem to RubyGems.org
|
51
|
+
#
|
52
|
+
# Parameters:
|
53
|
+
# 1. rubygems_version
|
54
|
+
function push_gem {
|
55
|
+
vagrant ssh -c "cd /vagrant && gem push ./${rubygems_gem}-${1}.gem"
|
56
|
+
}
|
57
|
+
|
58
|
+
|
59
|
+
# Move to the parent directory of this script
|
60
|
+
source="${BASH_SOURCE[0]}"
|
61
|
+
while [ -h "${source}" ] ; do source="$(readlink "${source}")"; done
|
62
|
+
dir="$( cd -P "$( dirname "${source}" )/.." && pwd )"
|
63
|
+
cd ${dir}
|
64
|
+
|
65
|
+
# Precondition for running
|
66
|
+
if [ $(running) != "0" ]; then
|
67
|
+
echo "Vagrant guest must be running to push"
|
68
|
+
exit 1
|
69
|
+
fi
|
70
|
+
|
71
|
+
# Can't pass args thru vagrant push so have to prompt
|
72
|
+
read -e -p "Please enter password for RubyGems.org user ${rubygems_user}: " rubygems_password
|
73
|
+
|
74
|
+
# Build, install & push
|
75
|
+
build_gem
|
76
|
+
rubygems_version=$(parse_version)
|
77
|
+
install_gem ${rubygems_version}
|
78
|
+
install_creds ${rubygems_password}
|
79
|
+
push_gem ${rubygems_version}
|
data/vagrant/up.bash
ADDED
@@ -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
|
data/vagrant/up.guidance
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
oss-playbooks/ruby-rvm.yml
|
metadata
ADDED
@@ -0,0 +1,180 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sluice-jason
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Alex Dean
|
8
|
+
- Michael Tibben
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2016-08-10 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.4'
|
20
|
+
name: contracts
|
21
|
+
prerelease: false
|
22
|
+
type: :runtime
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - "~>"
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '0.4'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.24'
|
34
|
+
name: fog
|
35
|
+
prerelease: false
|
36
|
+
type: :runtime
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - '='
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '1.24'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '2.14'
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: 2.14.1
|
51
|
+
name: rspec
|
52
|
+
prerelease: false
|
53
|
+
type: :development
|
54
|
+
version_requirements: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - "~>"
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '2.14'
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 2.14.1
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
name: rspec-nc
|
69
|
+
prerelease: false
|
70
|
+
type: :development
|
71
|
+
version_requirements: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
- !ruby/object:Gem::Dependency
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
82
|
+
name: guard
|
83
|
+
prerelease: false
|
84
|
+
type: :development
|
85
|
+
version_requirements: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
- !ruby/object:Gem::Dependency
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
name: guard-rspec
|
97
|
+
prerelease: false
|
98
|
+
type: :development
|
99
|
+
version_requirements: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
- !ruby/object:Gem::Dependency
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - ">="
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
name: coveralls
|
111
|
+
prerelease: false
|
112
|
+
type: :development
|
113
|
+
version_requirements: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
description: A Ruby gem to help you build ETL processes involving Amazon S3. Uses Fog
|
119
|
+
email:
|
120
|
+
- support@snowplowanalytics.com
|
121
|
+
executables: []
|
122
|
+
extensions: []
|
123
|
+
extra_rdoc_files: []
|
124
|
+
files:
|
125
|
+
- ".coveralls.yml"
|
126
|
+
- ".gitignore"
|
127
|
+
- ".travis.yml"
|
128
|
+
- CHANGELOG
|
129
|
+
- Gemfile
|
130
|
+
- Guardfile
|
131
|
+
- LICENSE-2.0.txt
|
132
|
+
- README.md
|
133
|
+
- Vagrantfile
|
134
|
+
- lib/sluice.rb
|
135
|
+
- lib/sluice/errors.rb
|
136
|
+
- lib/sluice/storage/s3/contracts.rb
|
137
|
+
- lib/sluice/storage/s3/location.rb
|
138
|
+
- lib/sluice/storage/s3/manifest.rb
|
139
|
+
- lib/sluice/storage/s3/s3.rb
|
140
|
+
- lib/sluice/storage/storage.rb
|
141
|
+
- lib/sluice/version.rb
|
142
|
+
- sluice.gemspec
|
143
|
+
- spec/spec_helper.rb
|
144
|
+
- spec/storage/s3/location_spec.rb
|
145
|
+
- spec/storage/s3/s3_spec.rb
|
146
|
+
- vagrant/.gitignore
|
147
|
+
- vagrant/ansible.hosts
|
148
|
+
- vagrant/peru.yaml
|
149
|
+
- vagrant/push.bash
|
150
|
+
- vagrant/up.bash
|
151
|
+
- vagrant/up.guidance
|
152
|
+
- vagrant/up.playbooks
|
153
|
+
homepage: http://snowplowanalytics.com
|
154
|
+
licenses:
|
155
|
+
- Apache-2.0
|
156
|
+
metadata: {}
|
157
|
+
post_install_message:
|
158
|
+
rdoc_options: []
|
159
|
+
require_paths:
|
160
|
+
- lib
|
161
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
162
|
+
requirements:
|
163
|
+
- - ">="
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: '0'
|
166
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
167
|
+
requirements:
|
168
|
+
- - ">="
|
169
|
+
- !ruby/object:Gem::Version
|
170
|
+
version: '0'
|
171
|
+
requirements: []
|
172
|
+
rubyforge_project:
|
173
|
+
rubygems_version: 2.4.8
|
174
|
+
signing_key:
|
175
|
+
specification_version: 4
|
176
|
+
summary: Ruby toolkit for cloud-friendly ETL
|
177
|
+
test_files:
|
178
|
+
- spec/spec_helper.rb
|
179
|
+
- spec/storage/s3/location_spec.rb
|
180
|
+
- spec/storage/s3/s3_spec.rb
|