small-ops 0.0.9 → 0.0.10

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.
Files changed (4) hide show
  1. data/bin/docker2etcd +4 -1
  2. data/bin/fige +4 -0
  3. data/lib/small-setup.rb +4 -0
  4. metadata +1 -1
data/bin/docker2etcd CHANGED
@@ -20,9 +20,12 @@ require 'small-setup'
20
20
  end
21
21
  container.keys.each {|key|
22
22
  if container[key] != nil then
23
- puts "#{key} = #{container[key]}"
23
+ if @verbose then
24
+ puts "#{key} = #{container[key]}"
25
+ end
24
26
  http_put("#{@etcd}/v2/keys#{@prefix}#{key}","value=#{URI.encode(container[key])}")
25
27
  end
26
28
  }
29
+ puts "-> #{name} : #{container["/#{name}/url"]}"
27
30
  }
28
31
 
data/bin/fige CHANGED
@@ -89,6 +89,10 @@ apps.each {|k|
89
89
  @containers.push(cid)
90
90
  puts "#{yml[k]['name']} = #{cid}"
91
91
 
92
+ if @cmd then
93
+ puts `#{@cmd}`
94
+ end
95
+
92
96
  }
93
97
 
94
98
  puts `docker ps`
data/lib/small-setup.rb CHANGED
@@ -35,6 +35,9 @@ OptionParser.new do |opts|
35
35
  opts.on("-u","--as_url","Make url as host/name instead of host:port") do |u|
36
36
  options[:as_url]=u
37
37
  end
38
+ opts.on("-v","--verbose","verboser") do |v|
39
+ options[:verbose]=v
40
+ end
38
41
  end.parse!
39
42
 
40
43
 
@@ -47,6 +50,7 @@ end.parse!
47
50
  @cmd = options[:cmd] || false
48
51
  @target = options[:target] || false
49
52
  @as_url = options[:as_url] || false
53
+ @verbose = options[:verbose] || false
50
54
 
51
55
  def http_get(uri)
52
56
  JSON.parse(Net::HTTP.get(URI(uri)))
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: small-ops
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: