dip 7.3.0 → 7.4.0

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: fd70c4af79fd861df4bfdb85662727067ad86b0b6705483ffbaf47818bf1a914
4
- data.tar.gz: adacf1505575f58dbfeff69377dd65a17bf883029e4108ea1ba678b41cfc7106
3
+ metadata.gz: 42554510aef42c0faa6c2d1ccec6be58c8997bbd1708d2a9e7008363dcc0916a
4
+ data.tar.gz: c2cc4e38f8f42fed73be2f88e0b66331521176d80c04bf789dccdf1de63e4d64
5
5
  SHA512:
6
- metadata.gz: 8dbe5aae1bd167ce4887a0557c8deaac21987480034f79efee0a45bd9718f9c41487c76f42cf6e51feac4764988e5145c394aeb657e299119d269555c3d5d01f
7
- data.tar.gz: 7972685fc3b4cbdf38e1ffbf60aed7786b2176967b5c850bb69ba463ba4a983ef0dc3c677c4e1b2b5fa6db8bdb47d8817cf83fa666e7abe749e74fc5715e6e5c
6
+ metadata.gz: c9bb9b9e632a899c9cb4433a8aeece65e3f5ebd9705c80fabea87f2197b5013a95dbaa522127cdf42f875c546e897f00b5068a3d421023b2d5f9a1d54f933a51
7
+ data.tar.gz: 5eee73a6bcfc1bbda1526fb04b3143dc2784be36b6b98a2b0855a376a0799113b7d79e17f48c02dd2504b577237662284f044c5cbed39e99d0a2d1fc2973720e
data/README.md CHANGED
@@ -30,6 +30,8 @@ Dip can be injected into the current shell (ZSH or Bash).
30
30
  eval "$(dip console)"
31
31
  ```
32
32
 
33
+ **IMPORTANT**: Beware of possible collisions with local tools. One particular example is supporting both local and Docker frontend build tools, such as Yarn. If you want some developer to run `yarn` locally and other to use Docker for that, you should either avoid adding the `yarn` command to the `dip.yml` or avoid using the shell integration for hybrid development.
34
+
33
35
  After that we can type commands without `dip` prefix. For example:
34
36
 
35
37
  ```sh
data/lib/dip/cli.rb CHANGED
@@ -69,8 +69,17 @@ module Dip
69
69
  end
70
70
 
71
71
  desc "down [OPTIONS]", "Run `docker-compose down` command"
72
+ method_option :help, aliases: "-h", type: :boolean, desc: "Display usage information"
73
+ method_option :all, aliases: "-A", type: :boolean, desc: "Shutdown all running docker-compose projects"
72
74
  def down(*argv)
73
- compose("down", *argv)
75
+ if options[:help]
76
+ invoke :help, ["down"]
77
+ elsif options[:all]
78
+ require_relative "commands/down_all"
79
+ Dip::Commands::DownAll.new.execute
80
+ else
81
+ compose("down", *argv)
82
+ end
74
83
  end
75
84
 
76
85
  desc "run [OPTIONS] CMD [ARGS]", "Run configured command in a docker-compose service. `run` prefix may be omitted"
data/lib/dip/command.rb CHANGED
@@ -20,8 +20,13 @@ module Dip
20
20
 
21
21
  class SubprocessRunner
22
22
  def self.call(cmdline, env: {}, panic: true, **options)
23
- return if ::Kernel.system(env, cmdline, **options)
24
- raise Dip::Error, "Command '#{cmdline}' executed with error." if panic
23
+ status = ::Kernel.system(env, cmdline, **options)
24
+
25
+ if !status && panic
26
+ raise Dip::Error, "Command '#{cmdline}' executed with error"
27
+ else
28
+ status
29
+ end
25
30
  end
26
31
  end
27
32
 
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../command"
4
+
5
+ module Dip
6
+ module Commands
7
+ class DownAll < Dip::Command
8
+ def execute
9
+ exec_subprocess(
10
+ "docker rm --volumes $(docker stop $(docker ps --filter 'label=com.docker.compose.project' -q))"
11
+ )
12
+ end
13
+ end
14
+ end
15
+ end
data/lib/dip/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dip
4
- VERSION = "7.3.0"
4
+ VERSION = "7.4.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dip
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.3.0
4
+ version: 7.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - bibendi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-19 00:00:00.000000000 Z
11
+ date: 2022-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -179,6 +179,7 @@ files:
179
179
  - lib/dip/commands/compose.rb
180
180
  - lib/dip/commands/console.rb
181
181
  - lib/dip/commands/dns.rb
182
+ - lib/dip/commands/down_all.rb
182
183
  - lib/dip/commands/list.rb
183
184
  - lib/dip/commands/nginx.rb
184
185
  - lib/dip/commands/provision.rb