dip 7.1.1 → 7.2.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: 5e42a461aef491ba31638884320252a28f891416510128a0dee140d8c8b3e8a8
4
- data.tar.gz: 836d775a9c88f2df8bc807207710f84b39502b4e1f7e19747cf4f231fb3e7b06
3
+ metadata.gz: 737530a0e1bcc0319fdd15a9f5a1cd21f5d5fe5283ed6e6811b322797608bbff
4
+ data.tar.gz: 246fd6ef9d149b08cbe260ca9d22247824029af5c018b525460c68cffdf8c104
5
5
  SHA512:
6
- metadata.gz: 88e61d6a5dfe78dd7dba7f1993ea8260f991fabc1921c144157dd4778bf1ccd4839472436327548d12b29222437bcfc08588f25a94e724fc74701b3a81c2d904
7
- data.tar.gz: 564e4cc1f1fe2aa824b9ca061a0e7a446074faeadb24ee620192cc53bcb3f7fab0cdf3d4849611ee963f7a0d3700089bc1932911096f740212165420b45e452d
6
+ metadata.gz: 54cf7a9194457a328326b4d43cef583c3baedfd880f3679fd2e6c2699b728b48f5017f238a957ab9c799145e790146695f15c5e4abd4ae0a1860ff58e177ead6
7
+ data.tar.gz: 69295132d41712bda09979dea08e504eae8d55805639c940545586bc8f4544e1963d36472cddc2e933758ecefa8783c468b8dcc6c3737ef4a82e7c2a6b313013
data/README.md CHANGED
@@ -47,7 +47,7 @@ When we change the current directory, all shell aliases will be automatically re
47
47
 
48
48
  Also, in shell mode Dip is trying to determine manually passed environment variables. For example:
49
49
 
50
- ```shhttps://ya-webdesign.com/images250_/vertical-divider-png-1.pnghttps://ya-webdesign.com/images250_/vertical-divider-png-1.png
50
+ ```sh
51
51
  VERSION=20180515103400 rails db:migrate:down
52
52
  ```
53
53
 
@@ -201,6 +201,8 @@ returned is `/app/sub-project-dir`.
201
201
 
202
202
  Run commands defined within the `interaction` section of dip.yml
203
203
 
204
+ By default, a command will be executed using [`docker compose`](https://docs.docker.com/compose/install/) command. If you are still using `docker-compose` binary (i.e., prior to Compose V2 changes), a command would be run through it. You can disable using of Compose V2 by passing an environment variable `DIP_COMPOSE_V2=false dip run`.
205
+
204
206
  ```sh
205
207
  dip run rails c
206
208
  dip run rake db:migrate
@@ -298,8 +300,6 @@ Runs Nginx server container based on [bibendi/nginx-proxy](https://github.com/bi
298
300
  foo-project/docker-compose.yml
299
301
 
300
302
  ```yml
301
- version: '2'
302
-
303
303
  services:
304
304
  foo-web:
305
305
  image: company/foo_image
@@ -320,8 +320,6 @@ networks:
320
320
  baz-project/docker-compose.yml
321
321
 
322
322
  ```yml
323
- version: '2'
324
-
325
323
  services:
326
324
  baz-web:
327
325
  image: company/baz_image
@@ -23,7 +23,11 @@ module Dip
23
23
 
24
24
  compose_argv = Array(find_files) + Array(cli_options) + argv
25
25
 
26
- exec_program("docker-compose", compose_argv, shell: shell)
26
+ if compose_v2?
27
+ exec_program("docker", compose_argv.unshift("compose"), shell: shell)
28
+ else
29
+ exec_program("docker-compose", compose_argv, shell: shell)
30
+ end
27
31
  end
28
32
 
29
33
  private
@@ -39,7 +43,7 @@ module Dip
39
43
  next unless file_path.exist?
40
44
 
41
45
  memo << "--file"
42
- memo << file_path.to_s
46
+ memo << Shellwords.escape(file_path.to_s)
43
47
  end
44
48
  end
45
49
  end
@@ -68,6 +72,14 @@ module Dip
68
72
  ip.empty? ? DOCKER_EMBEDDED_DNS : ip
69
73
  end
70
74
  end
75
+
76
+ def compose_v2?
77
+ if %w[false no 0].include?(Dip.env["DIP_COMPOSE_V2"]) || Dip.test?
78
+ return false
79
+ end
80
+
81
+ !!exec_subprocess("docker", "compose version", panic: false, out: File::NULL, err: File::NULL)
82
+ end
71
83
  end
72
84
  end
73
85
  end
@@ -78,7 +78,11 @@ module Dip
78
78
 
79
79
  def get_args
80
80
  if argv.any?
81
- argv
81
+ if command[:shell]
82
+ [argv.shelljoin]
83
+ else
84
+ Array(argv)
85
+ end
82
86
  elsif !(default_args = command[:default_args]).empty?
83
87
  if command[:shell]
84
88
  default_args.shellsplit
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.1.1"
4
+ VERSION = "7.2.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.1.1
4
+ version: 7.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - bibendi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-17 00:00:00.000000000 Z
11
+ date: 2021-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '0.20'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '1.1'
22
+ version: '2'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '0.20'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '1.1'
32
+ version: '2'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: bundler
35
35
  requirement: !ruby/object:Gem::Requirement