mcrain 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mcrain/base.rb +3 -1
- data/lib/mcrain/riak.rb +3 -2
- data/lib/mcrain/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 111888ffdf2dde9a910f755931c9f08cd2590102
|
4
|
+
data.tar.gz: 18d629850d3d0cf1bc619f27358312918c507238
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8464b124a581aca5c4f6ff14c4d693cc7bf011bd93b88694dd7ac6029b9022cc3c92ae4ded28f2f756c8483172742068ea824d715e0b090a8abc4cdb174b162e
|
7
|
+
data.tar.gz: 86093d944bef21880ff958992a62cfe0120dd851bc1ae54f48efca5a42a1601719be7d0aafb3f9ace5008c6ee0d4ab270fed697708c3b6f4ce7d615ae8c5f3da
|
data/lib/mcrain/base.rb
CHANGED
@@ -17,6 +17,8 @@ module Mcrain
|
|
17
17
|
|
18
18
|
attr_accessor :container_image, :port
|
19
19
|
end
|
20
|
+
|
21
|
+
attr_accessor :skip_reset_after_stop
|
20
22
|
def reset
|
21
23
|
instance_variables.each do |var|
|
22
24
|
instance_variable_set(var, nil)
|
@@ -52,7 +54,6 @@ module Mcrain
|
|
52
54
|
end
|
53
55
|
|
54
56
|
def start
|
55
|
-
reset
|
56
57
|
clear_old_container
|
57
58
|
run_container
|
58
59
|
if block_given?
|
@@ -143,6 +144,7 @@ module Mcrain
|
|
143
144
|
|
144
145
|
def stop
|
145
146
|
LoggerPipe.run(logger, "docker kill #{container_name}", timeout: 10)
|
147
|
+
reset unless skip_reset_after_stop
|
146
148
|
end
|
147
149
|
|
148
150
|
def logger
|
data/lib/mcrain/riak.rb
CHANGED
@@ -111,8 +111,7 @@ module Mcrain
|
|
111
111
|
attr_reader :host, :cids, :pb_ports, :uris, :admin_uris
|
112
112
|
attr_accessor :automatic_clustering, :cluster_size
|
113
113
|
|
114
|
-
def
|
115
|
-
super
|
114
|
+
def setup
|
116
115
|
w = @work_dir = Mcrain::Riak.docker_riak_path
|
117
116
|
raise "#{self.class.name}.docker_riak_path is blank. You have to set it to use the class" if w.blank?
|
118
117
|
raise "#{w}/Makefile not found" unless File.readable?(File.join(w, "Makefile"))
|
@@ -126,6 +125,7 @@ module Mcrain
|
|
126
125
|
end
|
127
126
|
|
128
127
|
def run_container
|
128
|
+
setup
|
129
129
|
logger.debug("cd #{@work_dir.inspect}")
|
130
130
|
Dir.chdir(@work_dir) do
|
131
131
|
# http://basho.co.jp/riak-quick-start-with-docker/
|
@@ -152,6 +152,7 @@ module Mcrain
|
|
152
152
|
Dir.chdir(@work_dir) do
|
153
153
|
LoggerPipe.run(logger, "#{@prepare_cmd} make stop-cluster")
|
154
154
|
end
|
155
|
+
reset unless skip_reset_after_stop
|
155
156
|
end
|
156
157
|
|
157
158
|
end
|
data/lib/mcrain/version.rb
CHANGED