Skip to content

Add --build flag for git stack deploys#472

Open
TimElschner wants to merge 1 commit intoFinsys:mainfrom
TimElschner:fix/git-stack-build-on-deploy
Open

Add --build flag for git stack deploys#472
TimElschner wants to merge 1 commit intoFinsys:mainfrom
TimElschner:fix/git-stack-build-on-deploy

Conversation

@TimElschner
Copy link
Contributor

Summary

  • Adds per-stack "Build images on deploy" toggle (default: true) so docker compose up includes --build when deploying git stacks via webhook, auto-update, or manual deploy
  • Fixes the issue where containers with build: directives in their compose file were recreated from cached images — code changes were never deployed
  • Flag threads through the entire deploy chain: DB → API → deployGitStackdeployStackexecuteComposeCommandexecuteLocalCompose / executeComposeViaHawser

Changes

Area Files What
DB Schema schema/index.ts, schema/pg-schema.ts build_on_deploy column (default true)
Migrations drizzle/0004_*, drizzle-pg/0004_* ALTER TABLE for SQLite + PostgreSQL
DB Functions db.ts GitStackData, createGitStack, updateGitStack
Deploy Chain stacks.ts --build in compose args + Hawser JSON body
Git Deploy git.ts Both deployGitStack and deployGitStackWithProgress
API api/git/stacks/+server.ts, [id]/+server.ts POST + PUT accept buildOnDeploy
Frontend GitStackModal.svelte TogglePill UI with Hammer icon
Tests tests/stack-git-flow.test.ts API-level tests for buildOnDeploy CRUD

Non-git stacks are unaffected

The build option only flows through when DeployStackOptions.build is explicitly set. Git stacks read it from gitStack.buildOnDeploy; all other stack types leave it undefined → no --build flag.

Test plan

  • Create a git stack with default settings → verify buildOnDeploy: true in response
  • Toggle "Build images on deploy" OFF → verify buildOnDeploy: false persists
  • Deploy a git stack with build: in compose file → verify --build appears in compose command
  • Deploy a git stack with buildOnDeploy: false → verify --build is absent
  • Deploy a non-git stack → verify no --build flag (no regression)
  • Test Hawser deploy path → verify JSON body includes build: true

🤖 Generated with Claude Code

@CLAassistant
Copy link

CLAassistant commented Feb 5, 2026

CLA assistant check
All committers have signed the CLA.

@jotka
Copy link
Contributor

jotka commented Feb 6, 2026

@TimElschner can you please remove claude from commits - we don't want Claude to be contributor in Dockhand. :)
(perhaps create a fresh PR)

Git stack deploys via webhook/auto-update were missing the --build flag,
so containers with build: directives never rebuilt on code changes.

Adds a per-stack "Build images on deploy" toggle (default: true) that
passes --build to docker compose up through the entire deploy chain
including Hawser remote agents.
@TimElschner TimElschner force-pushed the fix/git-stack-build-on-deploy branch from a38ed69 to 2173e27 Compare February 6, 2026 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants