Skip to content

refactor(bootstrap): split into configure/up, add state.json - #6

Open
BKJN1 wants to merge 1 commit into
mainfrom
feat/configure-up-split
Open

refactor(bootstrap): split into configure/up, add state.json#6
BKJN1 wants to merge 1 commit into
mainfrom
feat/configure-up-split

Conversation

@BKJN1

@BKJN1 BKJN1 commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

bootstrap used to be one function: check the machine, generate configs,
start everything — no way to stop in between. That's fine locally, where
the CLI owns the database it just created, but won't work for a real
server, where the database already exists and "change the schema" has to
be a decision someone makes on purpose, not a side effect of starting a
service. Groundwork for a separate versola migrate step ahead of
deploying to the VPS.

  • internal/deploy: split into Configure (prerequisite checks, runs
    versola-tools, writes the compose file) and Up (starts the stack,
    waits for readiness). bootstrap still calls both in sequence, so
    external behavior is unchanged — this is a pure refactor, verified by a
    local deployment behaving exactly as before.
  • internal/state: replaces the old bare version file with state.json
    (target, version, configuredAt, migratedAt, bundleDir), so later commands
    (status/migrate/up) can tell what's actually been deployed and how far
    along it got, instead of inferring it from which files happen to exist.
    Deployments made by earlier CLI builds still read correctly (loadLegacy).
  • Each configure run now gets its own bundle-<timestamp> directory
    instead of reusing one fixed path — works around a Docker Desktop bug
    where bind-mounting a wiped-and-recreated path can make a container's own
    cp fail with "File exists" for a file that doesn't exist.
  • internal/docker: Run/Cmd extracted out of bootstrap.go, reused by
    uninstall.go.

No behavior change for versola bootstrap local — verified locally.

- internal/deploy: Configure (checks + versola-tools + compose.yml) and
  Up (start stack, wait readiness) as separate steps, bootstrap.local
  calls both in sequence -- external behavior unchanged.
- internal/state: replace bare 'version' file with state.json
  (target/version/configuredAt/migratedAt), keep reading the old format
  for deployments made by earlier CLI builds.
- each configure run gets its own bundle-<timestamp> directory instead
  of reusing one fixed path -- works around a Docker Desktop bug where
  bind-mounting a wiped-and-recreated path can make cp fail with
  'File exists' for a file that doesn't exist.
- internal/docker: docker.Run/Cmd extracted out of bootstrap.go, reused
  by uninstall.go.
@augmentcode

augmentcode Bot commented Aug 15, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR refactors the local deployment lifecycle while preserving the existing bootstrap entry point.

  • Splits deployment preparation into deploy.Configure and stack startup/readiness handling into deploy.Up.
  • Keeps bootstrap local <version> invoking both stages sequentially, including optional browser launch behavior.
  • Moves Docker command construction and execution into a reusable internal/docker package.
  • Updates uninstall to use the shared Docker runner.
  • Replaces the bare deployment version file with versioned state.json metadata.
  • Records target, release version, configuration timestamp, migration placeholder, and generated bundle directory.
  • Retains legacy state loading so deployments created by prior CLI releases remain discoverable.
  • Stores generated Compose bundles in timestamped subdirectories to avoid reusing bind-mount paths.
  • Resolves status, down, and uninstall Compose paths through the recorded deployment state.
  • The separation establishes a handoff point for a future explicit migration step before server deployment startup.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread internal/state/state.go
@BKJN1

BKJN1 commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator Author

augment review

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

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.

1 participant