wslc-wip 0.14.0 → 0.14.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/lib/wip/initializer.rb +51 -4
- 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: 103045e33c74bb6772808c9a2e3029d35c90ce190c520df0ecc6d2a803b6108b
|
|
4
|
+
data.tar.gz: c70c47ae4c0d45a3ec0f9d695e4359d1d8915e5716b546c52d53280c1e49d09a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b51cdbdfe08a7d51ef750a8a5190583c9f3de894bf5e419b5890a6cdbfda4c9da1a1ab6fb175b763669100564e2e1741ff4bfc1dbf2819e46358680515e5fafb
|
|
7
|
+
data.tar.gz: 91b3608c4666a2e1023b3ce9e7069fe29d3fc8ecfa03cf0641e5e6da8d487b89b4fed13b3d948040e8b65b4d5e4828ac361b1be96ce8be470dbca8be58f58e5c
|
data/lib/wip/initializer.rb
CHANGED
|
@@ -6,17 +6,53 @@ module Wip
|
|
|
6
6
|
# mode: compose-native and mode: container, since that's the one decision
|
|
7
7
|
# `wip init` can't leave to a placeholder.
|
|
8
8
|
class Initializer
|
|
9
|
-
|
|
9
|
+
# Shared across both templates: every sync.* key SyncSettings understands,
|
|
10
|
+
# commented out with its default/behavior so nothing has to be looked up
|
|
11
|
+
# in the README to customize the mirror.
|
|
12
|
+
SYNC_TEMPLATE = <<~YAML.chomp
|
|
13
|
+
sync: {} # optional; mirrors the source into a named volume instead of bind-mounting it live
|
|
14
|
+
# source: . # optional; host path to mirror (default: wip.yml directory)
|
|
15
|
+
# target: /app # optional; in-container path the mirror volume mounts at (default: workdir, else /app)
|
|
16
|
+
# mount: /host-src # optional; read-only host mount inside the container (default: /host-src)
|
|
17
|
+
# volume: app-src # optional; named volume that holds the mirrored tree (default: "<container>-src")
|
|
18
|
+
# delete: true # optional; rsync --delete so removals on the host are mirrored too (default: true)
|
|
19
|
+
# exclude: [] # optional; rsync --exclude patterns, e.g. ["node_modules", "*.log"]
|
|
20
|
+
# command: rsync # optional; mirror binary to shell out to (default: rsync)
|
|
21
|
+
# options: [] # optional; extra flags appended to the mirror command
|
|
22
|
+
# interval: 2 # optional; seconds between mirrors (default: 2)
|
|
23
|
+
# mode: exec # optional; exec (default, mirrors into the running container) | run (fresh container each mirror)
|
|
24
|
+
# image: # optional; image the mirror container runs (required under mode: compose unless build: is set)
|
|
25
|
+
# build: # optional; let wip build a small dedicated mirror image instead of requiring one to exist
|
|
26
|
+
# dockerfile: # TODO required if build: is set
|
|
27
|
+
# tag: # optional (default: wip-sync-<container>:latest)
|
|
28
|
+
YAML
|
|
29
|
+
|
|
30
|
+
CONTAINER_TEMPLATE = <<~YAML.freeze
|
|
10
31
|
version: 1
|
|
11
|
-
mode: container
|
|
32
|
+
mode: container # container | compose | compose-native (see README)
|
|
12
33
|
container: app # TODO: rename freely, as long as it matches a key under dependencies: below
|
|
13
34
|
|
|
35
|
+
# wslc: {} # optional; override which wslc binary/path wip shells out to (default: auto)
|
|
36
|
+
# command: auto
|
|
37
|
+
|
|
38
|
+
# network: my-network # optional; container network name (mode: container only)
|
|
39
|
+
|
|
14
40
|
dependencies:
|
|
15
41
|
app: # this is the container wip creates, execs into, and runs commands in
|
|
16
42
|
image: your/image:tag # TODO: image to run
|
|
17
43
|
workdir: /app # TODO: adjust to match your image, or delete this line
|
|
44
|
+
# interactive: false # optional; keep stdin open / allocate a tty (default: false)
|
|
45
|
+
# remove: true # optional; remove the container after each run (default: true)
|
|
46
|
+
# env: {} # optional; environment variables passed to the container, e.g. {FOO: bar}
|
|
47
|
+
# ports: [] # optional; published ports, e.g. ["3000:3000"]
|
|
48
|
+
# volumes: [] # optional; extra -v specs beyond the source/sync mounts
|
|
18
49
|
|
|
19
|
-
|
|
50
|
+
# commands:
|
|
51
|
+
# test: # example custom command, invoked as `wip test`
|
|
52
|
+
# type: exec # optional; exec (default, runs in the running container) | run (fresh container) | build
|
|
53
|
+
# command: bundle exec rspec # TODO
|
|
54
|
+
|
|
55
|
+
#{SYNC_TEMPLATE}
|
|
20
56
|
YAML
|
|
21
57
|
|
|
22
58
|
def initialize(dir: Dir.pwd)
|
|
@@ -42,10 +78,21 @@ module Wip
|
|
|
42
78
|
# compose-for-wslc binary needed. Prefer a real compose tool instead? Use
|
|
43
79
|
# mode: compose (see README "Compose mode") and set compose.command.
|
|
44
80
|
|
|
81
|
+
# wslc: {} # optional; override which wslc binary/path wip shells out to (default: auto)
|
|
82
|
+
# command: auto
|
|
83
|
+
|
|
45
84
|
compose:
|
|
46
85
|
service: app # TODO: which service in #{compose_file} wip run/exec/NAME target
|
|
86
|
+
# file: #{compose_file} # optional; override which compose file to parse (default: auto-detected)
|
|
87
|
+
# project: # optional; project/network name (default: wip.yml directory name)
|
|
88
|
+
# command: # required under mode: compose (external compose-for-wslc binary); unused under compose-native
|
|
89
|
+
|
|
90
|
+
# commands:
|
|
91
|
+
# test: # example custom command, invoked as `wip test`
|
|
92
|
+
# type: exec # optional; exec (default, runs in the running container) | run (fresh container) | build
|
|
93
|
+
# command: bundle exec rspec # TODO
|
|
47
94
|
|
|
48
|
-
|
|
95
|
+
#{SYNC_TEMPLATE}
|
|
49
96
|
YAML
|
|
50
97
|
end
|
|
51
98
|
end
|
data/lib/wip/version.rb
CHANGED