refactor(bootstrap): split into configure/up, add state.json - #6
Open
BKJN1 wants to merge 1 commit into
Open
Conversation
- 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.
🤖 Augment PR SummarySummary: This PR refactors the local deployment lifecycle while preserving the existing
🤖 Was this summary useful? React with 👍 or 👎 |
Collaborator
Author
|
augment review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bootstrapused 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 migratestep ahead ofdeploying to the VPS.
internal/deploy: split intoConfigure(prerequisite checks, runsversola-tools, writes the compose file) and
Up(starts the stack,waits for readiness).
bootstrapstill calls both in sequence, soexternal behavior is unchanged — this is a pure refactor, verified by a
local deployment behaving exactly as before.
internal/state: replaces the old bareversionfile withstate.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).
configurerun now gets its ownbundle-<timestamp>directoryinstead 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
cpfail with "File exists" for a file that doesn't exist.internal/docker:Run/Cmdextracted out of bootstrap.go, reused byuninstall.go.
No behavior change for
versola bootstrap local— verified locally.