dip 7.7.0 → 7.8.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: f054f4d57aa8fcd971e84dfd09f64e45e468f902bec2390cea1ca22429ec5b5b
4
- data.tar.gz: c5d1f343917d8eb814cd12bf650f5c25fc82e642b97d24d39244ff79bd0a84c1
3
+ metadata.gz: 88f631de08ccd575c2e65930de249fbbba598e0948e8335fd9bbb4adf8a455c8
4
+ data.tar.gz: 0d906d4a243285684469524e85a8d494f12a13de58065e1ecf8eaccc6ef85903
5
5
  SHA512:
6
- metadata.gz: f95680b8f9393ceb447641751176a44343118621a5d37670cd41e5e82ff9093e3bdabb541809ef0df18580390b78c848feee7dafb97b05c445aa9798c4c48e2c
7
- data.tar.gz: ca40545fa4f180fd4c3740348e413ca760580aca68dc18f9f4839e3bc51155f3094a962294eba27b5fc10aa22df1ff178223c9bdaf9489cb7f6d53edef05e41c
6
+ metadata.gz: 51aa9e654715ee7836b9d143760dc028e9f06f811e0804decffc48fffcef4816e78c1f302f2d9af3462faad53a53efa755112804e116278372f447192572a06b
7
+ data.tar.gz: 12521190b37c170b54abaa319c3ad877999c9471f3936a7d732b2bbaeb776b922c28a8ab7d2ccc13322f73294419156f1d6156ccc35c2e1ac5709ac55d0bc8f2
data/README.md CHANGED
@@ -80,7 +80,7 @@ Also, you can check out examples at the top.
80
80
 
81
81
  ```yml
82
82
  # Required minimum dip version
83
- version: '7.5'
83
+ version: '7.7'
84
84
 
85
85
  environment:
86
86
  COMPOSE_EXT: development
@@ -222,6 +222,27 @@ dip run bash -c pwd
222
222
 
223
223
  returned is `/app/sub-project-dir`.
224
224
 
225
+ #### $DIP_CURRENT_USER
226
+
227
+ Exposes the current user ID (UID). It is useful when you need to run a container with the same user as the host machine. For example:
228
+
229
+ ```yml
230
+ # dip.yml (1)
231
+ environment:
232
+ UID: ${DIP_CURRENT_USER}
233
+ ```
234
+
235
+ ```yml
236
+ # docker-compose.yml (2)
237
+ services:
238
+ app:
239
+ image: ruby
240
+ user: ${UID:-1000}
241
+ ```
242
+
243
+ The container will run using the same user ID as your host machine.
244
+
245
+
225
246
  ### dip run
226
247
 
227
248
  Run commands defined within the `interaction` section of dip.yml
data/lib/dip/cli.rb CHANGED
@@ -28,7 +28,7 @@ module Dip
28
28
  argv.unshift("run")
29
29
  end
30
30
 
31
- super Dip::RunVars.call(argv, ENV)
31
+ super(Dip::RunVars.call(argv, ENV))
32
32
  end
33
33
  end
34
34
 
@@ -5,7 +5,7 @@ require "pathname"
5
5
  module Dip
6
6
  class Environment
7
7
  VAR_REGEX = /\$\{?(?<var_name>[a-zA-Z_][a-zA-Z0-9_]*)\}?/.freeze
8
- SPECIAL_VARS = %i[os work_dir_rel_path].freeze
8
+ SPECIAL_VARS = %i[os work_dir_rel_path current_user].freeze
9
9
 
10
10
  attr_reader :vars
11
11
 
@@ -63,5 +63,9 @@ module Dip
63
63
  def find_work_dir_rel_path
64
64
  @find_work_dir_rel_path ||= Pathname.getwd.relative_path_from(Dip.config.file_path.parent).to_s
65
65
  end
66
+
67
+ def find_current_user
68
+ @find_current_user ||= Process.uid
69
+ end
66
70
  end
67
71
  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.7.0"
4
+ VERSION = "7.8.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.7.0
4
+ version: 7.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - bibendi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-07 00:00:00.000000000 Z
11
+ date: 2024-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor