feat(local): one-shot deploy — local deploy alias + database by default when the push creates the site#10
Open
vikasiwp wants to merge 1 commit into
Open
feat(local): one-shot deploy — local deploy alias + database by default when the push creates the site#10vikasiwp wants to merge 1 commit into
local deploy alias + database by default when the push creates the site#10vikasiwp wants to merge 1 commit into
Conversation
…hen the push creates the site `local push` already provisioned a cloud site when given no target, but pushed files only, so the one-shot deploy landed users on a live site with none of their pages/posts/settings — and `--with-db` was only discoverable from a hint printed after the push. The command that sounds like the deploy path, `migrate push`, can't read a Playground instance at all (it needs wp-config.php MySQL creds; `local create` is SQLite). - add `local deploy` as an alias of `local push` - a site-CREATING push now includes the database by default (`shouldPushDb`); pushing into an existing site keeps it opt-in behind --with-db. New --no-db opts out of either. - skip the overwrite prompt + safety backup when the DB being replaced is the default WordPress install this command just provisioned (`freshSite`); both guards stay in force for an existing site. - help text: say `local push` creates the site when no target is given, and point `local create` users at `local deploy`, not `migrate push`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
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.
Problem
We already supported deploying a locally-built site to the cloud in one shot — but nobody could find it, and it shipped a half-empty site.
instawp local push <name>with no cloud-site argument already provisions a cloud site (POST /sites,is_reserved: true) and pushes into it. Nothing in the command name or its description ("Push local wp-content to an InstaWP cloud site") said so.wp-contentwent up; the pages, posts and settings — which live in the database — did not. You landed on a live site that looked empty, and only then saw a hint suggesting--with-db.migrate push [path], the "mirror" — cannot work on alocal createsite: it parseswp-config.phpforDB_NAME/DB_USER/DB_HOSTand exports viawp db export/mysqldump, but a Playground instance is SQLite (wp-content/database/.ht.sqlite) with no MySQL credentials. Users reaching for it hit a wall.Change
local deploy— a commander alias oflocal push. The discoverable verb for "make my local site live".shouldPushDb()(lib/local-instance.ts, unit-tested). Pushing into an existing site is unchanged — the DB stays opt-in behind--with-db, because it overwrites live data. New--no-dbopts out of either.wp db export-ing it are pure cost (the prompt also forced--jsondeploys to pass--force). Both guards stay fully in force for an existing site — threaded through asfreshSite..ht.sqliteused toexit(1). Now that the DB push is the default, that would abandon a half-finished deploy — site created, files pushed, then a hard exit. An auto-included DB now degrades to files-only with a warning; an explicit--with-dbstill fails loud.local pushcreates the cloud site when no target is given, and pointslocal createusers atlocal deployrather thanmigrate push.Verification
npm test— 492 passed (50 files), including 3 newshouldPushDbcases: the create-path default, the existing-site opt-in, and--no-dbwinning over both.XDG_CONFIG_HOME, no network):local deploy blog --dry-run→ "The local database would be pushed to the new site and its URLs rewritten."local push blog --dry-run --no-db→ "Files only (--no-db) — the new site would keep its empty WordPress database."--json→{"success":true,"dry_run":true,"would_create_site":"blog","would_push_db":true,...}.ht.sqlitehalf-deploy hardening above.local deploy(create → rsync → SQLite→MySQL import → search-replace) is going to the QA agent.Docs
The public docs at https://docs.instawp.com/cli/ describe the current behaviour and will need a matching revision (
cli-local-development.md"Move work between local and cloud" + the typical-loop example;cli-command-reference.md). Tracked for docs-bot, held until this merges andv0.0.1-beta.33is tagged.Release
Version bumped to
0.0.1-beta.33with a matching CHANGELOG heading, per this repo's tag-triggered release flow. Merging this publishes nothing — a human still pushes thev0.0.1-beta.33tag.Run
/code-review ultra <PR#>before merge.— Engineer (agent-os)