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 +4 -4
- data/README.md +22 -1
- data/lib/dip/cli.rb +1 -1
- data/lib/dip/environment.rb +5 -1
- data/lib/dip/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88f631de08ccd575c2e65930de249fbbba598e0948e8335fd9bbb4adf8a455c8
|
4
|
+
data.tar.gz: 0d906d4a243285684469524e85a8d494f12a13de58065e1ecf8eaccc6ef85903
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
data/lib/dip/environment.rb
CHANGED
@@ -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
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.
|
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:
|
11
|
+
date: 2024-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|