wslc-wip 0.16.0 → 0.17.1
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 +11 -0
- data/lib/wip/command_runner.rb +6 -2
- data/lib/wip/doctor.rb +6 -0
- data/lib/wip/initializer.rb +1 -11
- 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: d462bf5f1448a0488b717c963bccd77fc7c9719d29b74b990226179fd26e75f8
|
|
4
|
+
data.tar.gz: 7c05922ab0abc42995ed495c99704d2dbab435d8ab88ed46c9094a402052abed
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0cfc54266fde234fceac4dffc6f43968ab27123704040eaf6183dec8c54f25bc33daad08a5bd03a7552554474dc14848162dca40b0ebcde6a785c721632cc0b1
|
|
7
|
+
data.tar.gz: f4bfd8777b2f23b9f5c688b2d5794219914df74f42e44bb3a99b5c209e32fc262f240803ff5b8c505f427e19c3ee494d035a58fb407a8769c7ef7e9d723c1d14
|
data/README.md
CHANGED
|
@@ -153,6 +153,17 @@ bind-mounted](#slow-boot-when-the-app-directory-is-bind-mounted) for why. A `syn
|
|
|
153
153
|
that problem to `wip`: the source is mounted read-only, the app runs off a named volume, and wip
|
|
154
154
|
mirrors one into the other with `rsync`.
|
|
155
155
|
|
|
156
|
+
`wip up`'s pre-boot mirror always uses a throwaway container (the primary one isn't running yet),
|
|
157
|
+
so `sync.image`/`sync.build` apply there regardless of `sync.mode` — falling back to the primary
|
|
158
|
+
container's own image if neither is set under `mode: container`/`compose-native` (both have a
|
|
159
|
+
`dependencies:` entry to borrow it from); `mode: compose` has no such entry, so one of
|
|
160
|
+
`sync.image`/`sync.build` is required there. Where `sync.mode` actually matters is every mirror
|
|
161
|
+
*after* that: under `sync.mode: exec` (the default for `mode: container`/`compose-native`), `wip
|
|
162
|
+
sync`/`wip sync --watch` run `rsync` inside the already-running primary container instead, so
|
|
163
|
+
*that* image needs `rsync` installed — `sync.image`/`sync.build` are ignored for these. Under
|
|
164
|
+
`sync.mode: run`, every mirror (pre-boot included) uses a throwaway container, so `sync.image`/
|
|
165
|
+
`sync.build` (or the primary image fallback, where available) need `rsync` throughout.
|
|
166
|
+
|
|
156
167
|
```yaml
|
|
157
168
|
sync:
|
|
158
169
|
source: . # host path, relative to wip.yml (default: the wip.yml directory)
|
data/lib/wip/command_runner.rb
CHANGED
|
@@ -26,8 +26,7 @@ module Wip
|
|
|
26
26
|
threads.each(&:join)
|
|
27
27
|
status = wait.value
|
|
28
28
|
end
|
|
29
|
-
|
|
30
|
-
@stderr.puts("\n#{hint}") if !status.success? && hint
|
|
29
|
+
report_hint(captured) unless status.success?
|
|
31
30
|
status.exitstatus
|
|
32
31
|
rescue Errno::ENOENT => e
|
|
33
32
|
@stderr.puts e.message
|
|
@@ -39,6 +38,11 @@ module Wip
|
|
|
39
38
|
|
|
40
39
|
private
|
|
41
40
|
|
|
41
|
+
def report_hint(captured)
|
|
42
|
+
hint = @interpreter.interpret(captured.force_encoding(Encoding::UTF_8).scrub)
|
|
43
|
+
@stderr.puts("\n#{hint}") if hint
|
|
44
|
+
end
|
|
45
|
+
|
|
42
46
|
# Piping stdin/stdout/stderr (as `run` does above) closes the child's
|
|
43
47
|
# stdin immediately, which breaks anything that reads from the terminal
|
|
44
48
|
# (a shell, `rails console`, ...). Inherit the real file descriptors
|
data/lib/wip/doctor.rb
CHANGED
|
@@ -138,6 +138,12 @@ module Wip
|
|
|
138
138
|
results << result(File.directory?(sync.source) ? :ok : :fail,
|
|
139
139
|
"Sync source #{sync.source} mirrors into volume #{sync.volume} at #{sync.target}",
|
|
140
140
|
"Sync source not found: #{sync.source}")
|
|
141
|
+
return unless sync.exec? && (sync.image || sync.build)
|
|
142
|
+
|
|
143
|
+
results << Result.new(:warn, 'sync.image/sync.build only cover `wip up`’s one-time pre-boot mirror ' \
|
|
144
|
+
'(the primary container isn’t running yet, so that step always uses a ' \
|
|
145
|
+
'throwaway container) — sync.mode: exec’s `wip sync`/`wip sync --watch` run ' \
|
|
146
|
+
'rsync inside the primary container instead, so its image needs rsync too')
|
|
141
147
|
end
|
|
142
148
|
|
|
143
149
|
def result(condition, ok_message, fail_message)
|
data/lib/wip/initializer.rb
CHANGED
|
@@ -122,17 +122,7 @@ module Wip
|
|
|
122
122
|
# optional; exec (default, mirrors into the running container) | run (always a fresh container)
|
|
123
123
|
mode: exec
|
|
124
124
|
|
|
125
|
-
#
|
|
126
|
-
# image: your/image:tag
|
|
127
|
-
|
|
128
|
-
# alternative to image — let wip build a small dedicated mirror image itself
|
|
129
|
-
# build:
|
|
130
|
-
# dockerfile: |
|
|
131
|
-
# FROM alpine:latest
|
|
132
|
-
# RUN apk add --no-cache rsync
|
|
133
|
-
|
|
134
|
-
# optional (default: wip-sync-<container>:latest)
|
|
135
|
-
# tag: wip-sync-app:latest
|
|
125
|
+
# sync.image/sync.build — required for mode: compose and used by sync.mode: run; see README "Source sync"
|
|
136
126
|
YAML
|
|
137
127
|
end
|
|
138
128
|
|
data/lib/wip/version.rb
CHANGED