mcrain 0.3.0 → 0.3.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: 6f545f6d11fb457a716f1c92fddcb37176812774
4
- data.tar.gz: 1561509c7757f78be3c824a58ed26e3d85d4d0db
3
+ metadata.gz: 5a827b7fa0a1b8a568712e027c1378e0b1f9ef8a
4
+ data.tar.gz: 975971865b932bbbaace5fb3b6a1158b564d905b
5
5
  SHA512:
6
- metadata.gz: 93b20d5949f9d9987b0bd20f3f1b692f8c1a43e9a097f9852ce501f38076af3fb8707a14a8c8341a63a8271371e0be95cf7b4ca8eec79062331bc63a79e0d378
7
- data.tar.gz: ac43d72e32ab2d9dd991e2bc3a7cd4d57c16ca89eec072dd5bf44d6a48ee033e68f58bcf8755087558404eb0cb108a6407b0fedb672e367ec8e02da8a37439c5
6
+ metadata.gz: eda8ede3198ff5cdd6804e32f5c1cbd2ed9729efd2f5ef5076f6447faf9290aa5fb37854c3c98153339eada33d917acb4f1d7cf42451ebbf0a1ace49c1cff3da
7
+ data.tar.gz: 2b4ca199e94c665359f1b027ed09d6c1e1af2a25f407f2a128534be6a7332731b68e01c2bb0df4f40db105676b95962c138f2cce3b6e51b01f2e915a0aae9ec8
@@ -68,8 +68,16 @@ module Mcrain
68
68
  self
69
69
  end
70
70
 
71
+ def info
72
+ container.json
73
+ end
74
+
75
+ def name
76
+ info["Name"] # .sub(/\A\//, '')
77
+ end
78
+
71
79
  def ip
72
- container.json["NetworkSettings"]["IPAddress"]
80
+ info["NetworkSettings"]["IPAddress"]
73
81
  end
74
82
 
75
83
  def ssh_uri
data/lib/mcrain/riak.rb CHANGED
@@ -50,12 +50,12 @@ module Mcrain
50
50
  r = super
51
51
  r['HostConfig']['PortBindings']["8098/tcp"] = [{ 'HostPort' => http_port.to_s }]
52
52
  envs = []
53
- envs << "RIAK_CLUSTER_SIZE=#{owner.cluster_size}"
53
+ envs << "DOCKER_RIAK_CLUSTER_SIZE=#{owner.cluster_size}"
54
54
  envs << "DOCKER_RIAK_AUTOMATIC_CLUSTERING=#{owner.automatic_clustering ? 1 : 0}"
55
55
  envs << "DOCKER_RIAK_BACKEND=#{owner.backend}"
56
56
  r['Env'] = envs unless envs.empty?
57
57
  if primary_node
58
- r['HostConfig']['Links'] = ["#{primary_node.container.name}:seed"]
58
+ r['HostConfig']['Links'] = ["#{primary_node.name}:seed"]
59
59
  end
60
60
  return r
61
61
  end
@@ -142,7 +142,18 @@ module Mcrain
142
142
 
143
143
  def setup
144
144
  Boot2docker.setup_docker_options
145
- nodes.map(&:container).each(&:start!)
145
+ # setup_nodes(nodes[0, 1]) # primary node
146
+ # setup_nodes(nodes[1..-1])
147
+ nodes.each do |node|
148
+ setup_nodes([node])
149
+ end
150
+ end
151
+
152
+ def setup_nodes(nodes)
153
+ return if nodes.empty?
154
+ containers = nodes.map(&:container)
155
+ containers.each(&:start!)
156
+
146
157
  # http://basho.co.jp/riak-quick-start-with-docker/
147
158
  #
148
159
  # "Please wait approximately 30 seconds for the cluster to stabilize"
@@ -164,6 +175,7 @@ module Mcrain
164
175
  raise msg
165
176
  end
166
177
  end
178
+ logger.info("container started: " << containers.map{|c| c.json}.join("\n"))
167
179
  end
168
180
 
169
181
  def teardown
@@ -1,3 +1,3 @@
1
1
  module Mcrain
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mcrain
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - akm
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-07-29 00:00:00.000000000 Z
11
+ date: 2015-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logger_pipe