unoverse 0.1.147 → 0.1.149
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.
package/bin/unoverse.mjs
CHANGED
|
@@ -145,7 +145,19 @@ switch (cmd) {
|
|
|
145
145
|
|
|
146
146
|
case "studio": {
|
|
147
147
|
// Studio is its own npm app; this is a launcher, not a wrapper.
|
|
148
|
-
|
|
148
|
+
//
|
|
149
|
+
// Launched by EXACT version, resolved fresh, never `@latest`: npx keys its cache
|
|
150
|
+
// by the spec, and a cached `@latest` entry updates the top package IN PLACE while
|
|
151
|
+
// reusing whatever dependencies already satisfy their ranges — observed live as
|
|
152
|
+
// studio 0.1.43 running against a base two releases stale, which is how a
|
|
153
|
+
// developer gets last week's lint under this week's screens. An exact spec is a
|
|
154
|
+
// new cache key, so every studio release installs clean and fully resolved, and
|
|
155
|
+
// relaunching the same version stays instant from cache. Offline (npm view
|
|
156
|
+
// fails), fall back to the cached latest — stale beats broken with no network.
|
|
157
|
+
const view = spawnSync("npm", ["view", "@unoverse-platform/studio", "version"], { encoding: "utf8" });
|
|
158
|
+
const exact = view.status === 0 ? view.stdout.trim() : "";
|
|
159
|
+
const spec = exact ? `@unoverse-platform/studio@${exact}` : "@unoverse-platform/studio@latest";
|
|
160
|
+
const r = spawnSync("npx", ["-y", spec, ...args], {
|
|
149
161
|
stdio: "inherit",
|
|
150
162
|
});
|
|
151
163
|
process.exit(r.status ?? 0);
|
|
@@ -77,6 +77,35 @@
|
|
|
77
77
|
docker compose up -d 2>&1 | tail -6
|
|
78
78
|
register: up_result
|
|
79
79
|
|
|
80
|
+
# `up -d` RECREATES ON CONFIG CHANGE, NOT ON IMAGE CHANGE — not reliably, and not on
|
|
81
|
+
# every compose version. On a live ground it moved every service to the new images
|
|
82
|
+
# except one: umap's new image was pulled and sitting on disk while the container kept
|
|
83
|
+
# running the old one, twice across two deploys, and the only symptom was a model bug
|
|
84
|
+
# that had already been fixed. So the deploy verifies its own work: any service whose
|
|
85
|
+
# running container is not on the image its tag now points to is recreated by name.
|
|
86
|
+
- name: "[3b/4] Recreate services the restart left on an old image"
|
|
87
|
+
shell: |
|
|
88
|
+
cd {{ gravity_dir }}
|
|
89
|
+
stale=""
|
|
90
|
+
for c in $(docker compose ps -q); do
|
|
91
|
+
running=$(docker inspect --format '{{ '{{' }}.Image{{ '}}' }}' "$c")
|
|
92
|
+
tag=$(docker inspect --format '{{ '{{' }}.Config.Image{{ '}}' }}' "$c")
|
|
93
|
+
current=$(docker image inspect --format '{{ '{{' }}.Id{{ '}}' }}' "$tag" 2>/dev/null || true)
|
|
94
|
+
svc=$(docker inspect --format '{{ '{{' }}index .Config.Labels "com.docker.compose.service"{{ '}}' }}' "$c")
|
|
95
|
+
[ -n "$current" ] && [ "$running" != "$current" ] && stale="$stale $svc"
|
|
96
|
+
done
|
|
97
|
+
if [ -n "$stale" ]; then
|
|
98
|
+
echo "stale:$stale"
|
|
99
|
+
docker compose up -d --force-recreate $stale 2>&1 | tail -6
|
|
100
|
+
else
|
|
101
|
+
echo "every service is on the image its tag points to"
|
|
102
|
+
fi
|
|
103
|
+
register: recreate_result
|
|
104
|
+
|
|
105
|
+
- name: "[3b/4] Recreate output"
|
|
106
|
+
debug:
|
|
107
|
+
msg: "{{ recreate_result.stdout_lines | default(['done']) }}"
|
|
108
|
+
|
|
80
109
|
- name: "[4/4] Service status"
|
|
81
110
|
shell: |
|
|
82
111
|
cd {{ gravity_dir }}
|
package/package.json
CHANGED