wslc-wip 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/lib/wip/command_builder.rb +2 -0
- data/lib/wip/config.rb +3 -0
- data/lib/wip/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: aacee07e7929d736a13e1a7a4812a52155431b311913a4e5fa25409f6c772f60
|
|
4
|
+
data.tar.gz: 31de690c5b1040a9d0cb0c12890f20cf8d07f1d3d57e74d44140d8af30d7e0f0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 13e7a7c473c92063c6c9bc505ea72b03a8fab8269a6deb0ae2f27fb6309a2848477257b3d759b917eb2e6ddf86dc3b3144fbb98031e6548ece4ae2eaf14f166e
|
|
7
|
+
data.tar.gz: 494a24787a32f87479e8c984617e1928c54b43864b9a247da042281b138cd48795970e05ebb69b9805b31a8dd239a0c190f5554f9f427b29f81c1b9a42b669d9
|
data/README.md
CHANGED
|
@@ -45,6 +45,8 @@ defaults:
|
|
|
45
45
|
- "3000:3000"
|
|
46
46
|
volumes:
|
|
47
47
|
- ".:/app"
|
|
48
|
+
up:
|
|
49
|
+
command: server # `wip up` がコンテナ作成時にイメージへ渡す常駐コマンド(未指定ならイメージの既定 CMD)
|
|
48
50
|
commands:
|
|
49
51
|
rails:
|
|
50
52
|
type: exec
|
|
@@ -82,7 +84,7 @@ commands:
|
|
|
82
84
|
| `wip doctor` | WSL2、相互運用、WSLC、設定、アーキテクチャ、Git を診断 |
|
|
83
85
|
| `wip config` | デフォルト適用済み設定(秘密値をマスク) |
|
|
84
86
|
| `wip build -- --no-cache` | build 定義でイメージをビルド |
|
|
85
|
-
| `wip up [-d]` | `defaults.container`
|
|
87
|
+
| `wip up [-d]` | `defaults.container` を起動(無ければ `up.command` 付きで作成)。`-d` でバックグラウンド実行 |
|
|
86
88
|
| `wip down` | `defaults.container` を停止・削除 |
|
|
87
89
|
| `wip exec [--no-interactive] COMMAND...` | 既存コンテナ内で実行 |
|
|
88
90
|
| `wip run [--no-interactive] COMMAND...` | `--rm` の新規コンテナで実行 |
|
data/lib/wip/command_builder.rb
CHANGED
|
@@ -32,6 +32,8 @@ module Wip
|
|
|
32
32
|
command << '-d' if detach
|
|
33
33
|
command << '-it' if !detach && tty?(true)
|
|
34
34
|
command.concat(options(values)).push(required(values, 'image'))
|
|
35
|
+
command.concat(Shellwords.split(@config.up_command.to_s)) if @config.up_command
|
|
36
|
+
command
|
|
35
37
|
end
|
|
36
38
|
|
|
37
39
|
def start(detach: false)
|
data/lib/wip/config.rb
CHANGED
|
@@ -17,6 +17,7 @@ module Wip
|
|
|
17
17
|
def wslc_command = @raw.dig('wslc', 'command') || 'auto'
|
|
18
18
|
def commands = @raw['commands'] || {}
|
|
19
19
|
def defaults = DEFAULTS.merge(@raw['defaults'] || {})
|
|
20
|
+
def up_command = @raw.dig('up', 'command')
|
|
20
21
|
|
|
21
22
|
def command(name)
|
|
22
23
|
entry = commands[name.to_s]
|
|
@@ -27,6 +28,7 @@ module Wip
|
|
|
27
28
|
|
|
28
29
|
def to_h(redact: true)
|
|
29
30
|
value = { 'version' => 1, 'wslc' => { 'command' => wslc_command }, 'defaults' => defaults,
|
|
31
|
+
'up' => { 'command' => up_command },
|
|
30
32
|
'commands' => commands.transform_values { |entry| defaults.merge('type' => 'exec').merge(entry) } }
|
|
31
33
|
redact ? redact_secrets(value) : value
|
|
32
34
|
end
|
|
@@ -36,6 +38,7 @@ module Wip
|
|
|
36
38
|
def validate!
|
|
37
39
|
raise ConfigError, "Unsupported configuration version: #{@raw['version']}" unless (@raw['version'] || 1) == 1
|
|
38
40
|
raise ConfigError, 'commands must be a mapping' unless commands.is_a?(Hash)
|
|
41
|
+
raise ConfigError, 'up must be a mapping' if @raw.key?('up') && !@raw['up'].is_a?(Hash)
|
|
39
42
|
|
|
40
43
|
commands.each { |name, entry| validate_command!(name, entry) }
|
|
41
44
|
end
|
data/lib/wip/version.rb
CHANGED