cranium 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aa44efc27b0fc354b994ea3c8738d5e6aeab2415
4
- data.tar.gz: 036dfbc242e5858bad5fd374cc0b1c27bda4b6da
3
+ metadata.gz: ded6526a7ab3b7875f8561df207318f256eda9ee
4
+ data.tar.gz: 13d3b0f04ed8d2a69f2ff21250ab48abf226368d
5
5
  SHA512:
6
- metadata.gz: a90bc3b7ee0cd635b13e9deb325e4bc58fe83889816ac9b7bc02637318f096b953caa01ce44a6314ac67a74d0374beba991548ba46349250f01914e591cf1554
7
- data.tar.gz: d95a477491949134ef37a86c165d4fdc19615fa12e53fed042af1bd838788a290c64b9ffa9a59db420b446e46544103315f6a18f337c1d09d2713665a9a2fc7d
6
+ metadata.gz: 4e7e5574b8a0f51ebcd8bd2b3fcfdf6c9d2b8ece9fbc361022cc90bf7183fb00f9bc4c2a5eca3ca6c390763d429c0bf5b358a8fc58368efb49ce3f4965c0d795
7
+ data.tar.gz: 4f7a839e74dc68656d2b1754ca20ffa936241b1954f38fc841928fec471ea065ca83e00d2c5069bb313d00eaed4080a8c78e4cf350f410bc9bafa964fc2c6778
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Cranium
2
2
 
3
- TODO: Write a gem description
3
+ An awesome ETL tool.
4
4
 
5
5
  ## Installation
6
6
 
@@ -16,9 +16,23 @@ Or install it yourself as:
16
16
 
17
17
  $ gem install cranium
18
18
 
19
- ## Usage
19
+ ## Development
20
+
21
+ start up the db
22
+
23
+ docker-compose create && docker-compose start
24
+
25
+ find out what's the ip is (in case you're using native docker)
26
+
27
+ docker-compose ps
28
+
29
+ (if using docker-machine use the machine's ip)
30
+ setup the DATABASE_HOST enviroment variable to this IP (192.168.64.4 in my case)
31
+
32
+ export DATABASE_HOST=192.168.64.4
33
+
34
+ Now, your ready to run the integration tests :)
20
35
 
21
- TODO: Write usage instructions here
22
36
 
23
37
  ## Contributing
24
38
 
data/cranium.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'cranium'
3
- spec.version = '0.2.0'
3
+ spec.version = '0.2.1'
4
4
  spec.authors = ['Emarsys Technologies']
5
5
  spec.email = ['smart-insight-dev@emarsys.com']
6
6
  spec.description = %q{Provides Extract, Transform and Load functionality for loading data from CSV files to a Greenplum database.}
data/db/start.sh ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env bash
2
+
3
+ echo "127.0.0.1 $(cat ~/orig_hostname)" >> /etc/hosts
4
+
5
+ service sshd start
6
+
7
+ su - gpadmin -c /usr/local/bin/run.sh
8
+ su - gpadmin -c 'cat /db/setup.sql | psql -e'
9
+ su - gpadmin -c 'gpfdist -d /home/gpadmin/gpfdist-data -p 8123'
data/docker-compose.yml CHANGED
@@ -1,8 +1,9 @@
1
1
  greenplum:
2
2
  image: kevinmtrowbridge/gpdb-docker
3
3
  ports:
4
- - 22:22
5
4
  - 5432:5432
6
5
  - 8123:8123
7
6
  volumes:
8
7
  - ./tmp/custdata:/home/gpadmin/gpfdist-data
8
+ - ./db:/db
9
+ command: sh /db/start.sh
@@ -16,8 +16,7 @@ Feature: Sequel database connections are fault tolerant
16
16
  require 'sequel'
17
17
 
18
18
  def terminate_connections
19
- connection_string = ENV['GREENPLUM_AS_ADMIN_URL'] || "postgres://database_administrator:emarsys@192.168.56.43:5432/cranium"
20
- connection = Sequel.connect connection_string, loggers: Cranium.configuration.loggers
19
+ connection = Sequel.connect "postgres://database_administrator:emarsys@#{ENV['DATABASE_HOST'] || '192.168.56.43'}:5432/cranium", loggers: Cranium.configuration.loggers
21
20
  connection.run("SELECT pg_terminate_backend(procpid) FROM pg_stat_activity WHERE procpid <> pg_backend_pid() AND datname = 'cranium'")
22
21
  end
23
22
 
@@ -4,8 +4,8 @@ require_relative "../../lib/cranium"
4
4
  FileUtils.mkdir_p("log") unless Dir.exists?("log")
5
5
 
6
6
  Cranium.configure do |config|
7
- config.greenplum_connection_string = ENV['GREENPLUM_URL'] || "postgres://cranium:cranium@192.168.56.43:5432/cranium"
8
- config.gpfdist_url = ENV['GPFDIST_URL'] || "192.168.56.43:8123"
7
+ config.greenplum_connection_string = "postgres://cranium:cranium@#{ENV['DATABASE_HOST'] || '192.168.56.43'}:5432/cranium"
8
+ config.gpfdist_url = "#{ENV['DATABASE_HOST'] || '192.168.56.43'}:8123"
9
9
  config.gpfdist_home_directory = "tmp/custdata"
10
10
  config.upload_directory = "cranium_build"
11
11
  config.loggers << Logger.new("log/cucumber.log")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cranium
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emarsys Technologies
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-22 00:00:00.000000000 Z
11
+ date: 2016-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg
@@ -156,6 +156,7 @@ files:
156
156
  - config/cucumber.yml
157
157
  - cranium.gemspec
158
158
  - db/setup.sql
159
+ - db/start.sh
159
160
  - docker-compose.yml
160
161
  - examples/config.rb
161
162
  - examples/deduplication.rb