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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2eab1ae91f7d9e73884273cedd2b581a54d53a80
4
- data.tar.gz: 9e853f3952c4d2b718c0d49d42c60cf628199999
3
+ metadata.gz: 111888ffdf2dde9a910f755931c9f08cd2590102
4
+ data.tar.gz: 18d629850d3d0cf1bc619f27358312918c507238
5
5
  SHA512:
6
- metadata.gz: 4a3edb11335ff2b994b90b77134e527dd92584e13f52981f1b2877dfd8d4bbeea38ef2dc0811c170e59f46654cd2e9a93cc8e95e67006026f583708ea540e16b
7
- data.tar.gz: 9979c2da2473d65bb7ff9cf2ce9ad325f6392b8262629f176b1f41291d4e651ebd0e99299b05d50481b0bf475cb35e595be462038056c780d74e54a2f18091dc
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 reset
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
@@ -1,3 +1,3 @@
1
1
  module Mcrain
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mcrain
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - akm