dry-stack 0.0.69 → 0.0.70

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
  SHA256:
3
- metadata.gz: f4d18a6292393e8f5f02702fc817a79919e54ad2ba51741593befcee11d60e42
4
- data.tar.gz: 9cc4966982e230b7917ba8b0580cfa6bf6aa9ccea39bb8646a660dbd7249ce2e
3
+ metadata.gz: 347130396d5cf0de94694fdc5d5edcce940833d0dd4e7c05726fa218c0669801
4
+ data.tar.gz: c62702ddffe13310445c8c830fa5cabb06763ed9ae71477d4e41e15c7f8239c5
5
5
  SHA512:
6
- metadata.gz: b74523d6dafa1ba2be675a221ca7b9f4f064c0d1e5cbbc0e10505b881c7b0ffd19dfdef5ba29f49ddecdbcea09b537fb60b7e79d4f2a88d63a68c1d04bf554a6
7
- data.tar.gz: c67d9edd77c96176e80d9b6a0511fbe3ebab6d3f4f02fbcc72dd4de247af8c382a145d12f24f6e77da2276ad33670d711ad63979eaa6bf1f27761eb5b28071b6
6
+ metadata.gz: 738b139b5a8ead311d1c1445a88418cdf0d31f4c18a6e200515338f32a6dd041c9e324dffb998b3df9f19d8ed1323c34b340027ef3786b6c43152ce27f007973
7
+ data.tar.gz: 5f67d76cf8c9d3ebb4b4b8e21dd71d6a420dfa514c955bae2c23dc6d12005d3793587c91895992f767efd18c2d16d884bbd416f39fec995f5535873985336fe6
@@ -1,7 +1,7 @@
1
1
  require_relative 'command_line'
2
2
 
3
3
  Dry::CommandLine::COMMANDS[:to_compose] = Class.new do
4
- def run(stack, params, args)
4
+ def run(stack, params, args, extra)
5
5
  raise "unsupported args: #{args}" unless args.empty?
6
6
  _params = stack.options.merge params
7
7
  stack.name = _params[:name] if _params[:name]
@@ -42,7 +42,10 @@ module Dry
42
42
  def run(args)
43
43
  params = {}
44
44
 
45
+ a, extra = ARGV.join(' ').split( / -- /)
46
+ ARGV.replace a.split if a
45
47
  ARGV << '-h' if ARGV.empty?
48
+
46
49
  OptionParser.new do |o|
47
50
  o.version = "#{Dry::Stack::VERSION}"
48
51
 
@@ -54,7 +57,7 @@ module Dry
54
57
  o.banner = "Version: #{o.version}\nUsage:\n\t#{usage.join "\n\t"}"
55
58
  o.separator ''
56
59
  o.separator 'Commands:'
57
- COMMANDS.each { |name, cmd| o.separator "#{' ' * 5}#{name} - #{cmd.help}" }
60
+ COMMANDS.each { |name, cmd| o.separator "#{' ' * 5}#{name} - #{[cmd.help].flatten.join "\n#{' ' * (5+4 + name.size)}" }" }
58
61
 
59
62
  o.separator ''
60
63
  o.separator 'Options:'
@@ -82,7 +85,7 @@ module Dry
82
85
  safe_eval stack_text # isolate context
83
86
 
84
87
  Stack.last_stack.name = params[:name] if params[:name]
85
- COMMANDS[command.to_sym].run Stack.last_stack, params, args
88
+ COMMANDS[command.to_sym].run Stack.last_stack, params, args, extra
86
89
  rescue => e
87
90
  puts e.message
88
91
  ENV['DEBUG'] ? raise : exit(1)
@@ -1,8 +1,9 @@
1
1
  require_relative 'command_line'
2
2
 
3
3
  Dry::CommandLine::COMMANDS[:swarm_deploy] = Class.new do
4
- def run(stack, params, args)
4
+ def run(stack, params, args, extra)
5
5
  unless args.empty?
6
+ c_name = args[0].to_sym
6
7
  raise "deploy config not found: #{args[0]}" unless stack.swarm_deploy.key? args[0].to_sym
7
8
  context = stack.swarm_deploy[args[0].to_sym]
8
9
  end
@@ -37,7 +38,8 @@ Dry::CommandLine::COMMANDS[:swarm_deploy] = Class.new do
37
38
  system " echo \"#{yaml.gsub("`", '\\\`')}\"" if _params[:v]
38
39
  # system " echo \"#{yaml.gsub("`", '\\\`')}\" | docker stack deploy -c - #{stack.name} --prune --resolve-image changed"
39
40
 
40
- exec_i "docker stack deploy -c - #{stack.name} --prune --resolve-image changed", yaml
41
+ # --prune --resolve-image changed
42
+ exec_i "docker stack deploy -c - #{stack.name} #{extra}", yaml
41
43
  system "docker config rm $(docker config ls --filter label=com.docker.stack.namespace=#{stack.name} --format \"{{.ID}}\")"
42
44
 
43
45
  exec_i "docker config rm #{stack.name}_readme || echo 'failed to remove config #{stack.name}_readme'"
@@ -45,7 +47,9 @@ Dry::CommandLine::COMMANDS[:swarm_deploy] = Class.new do
45
47
  exec_i "docker config create #{stack.name}_readme -", stack.description
46
48
  end
47
49
 
48
- def help = 'Call docker stack deploy & add config readme w/ description'
50
+ def help = ['Call docker stack deploy & add config readme w/ description',
51
+ '[... swarm_deploy sd_name -- --prune --resolve-image changed]']
52
+
49
53
  end.new
50
54
 
51
55
 
data/lib/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Dry
2
2
  class Stack
3
- VERSION = '0.0.69'
3
+ VERSION = '0.0.70'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dry-stack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.69
4
+ version: 0.0.70
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artyom B
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-29 00:00:00.000000000 Z
11
+ date: 2024-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake