Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions scripts/deploy-selfhost-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ cat >"$override_file" <<YAML
services:
$SERVICE:
image: "$IMAGE"
# An operator's own docker-compose.override.yml may define a \`build:\` block for this service (e.g. a
# local INSTALL_AI_CLIS customization) -- when BOTH build and image are present, \`up --no-build\` still
# prefers a pre-existing project-scoped build artifact over the pulled image, silently ignoring it. Reset
# unsets any build config from every earlier -f file so the pulled image always wins. Harmless no-op when
# no build: block exists at all.
build: !reset null
YAML

mapfile -t compose_args < <(compose_file_args)
Expand Down
5 changes: 4 additions & 1 deletion test/unit/selfhost-image-deploy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ if [ "$1" = "compose" ]; then
prev="$arg"
done
if [ -n "$last_file" ]; then
grep 'image:' "$last_file" >> "$DOCKER_IMAGES"
cat "$last_file" >> "$DOCKER_IMAGES"
fi
exit 0
;;
Expand Down Expand Up @@ -153,6 +153,9 @@ describe("self-host image deploy script", () => {
expect(result.status, result.stderr).toBe(0);
expect(readFileSync(harness.envPath, "utf8")).toContain(`GITTENSORY_IMAGE=${expected}`);
expect(harness.readImages()).toContain(`image: "${expected}"`);
// REGRESSION: without this reset, an operator's own docker-compose.override.yml build: block for this
// service silently wins over the pulled image at `up --no-build` time (found deploying live).
expect(harness.readImages()).toContain("build: !reset null");
expect(harness.readCalls()).toContain("up -d --no-build --no-deps gittensory");
expect(harness.readCalls()).not.toContain(" build ");
} finally {
Expand Down
Loading