Skip to content

0.6.0

Choose a tag to compare

@MatthewKennedy MatthewKennedy released this 14 May 11:40
· 9 commits to main since this release
8cf56b1

fp init — one command, fresh clone to ready-to-design

git clone git@github.com:<your-org>/<your-site>.git
cd <your-site>
fp init

That's it. Designer is in the WP admin a couple of minutes later, with the previous designer's snapshot already applied — assets, templates, options, the lot.

Re-running fp init after docker compose down -v is the canonical recovery flow: same command, brings volumes back from empty to the state captured by the latest snapshot, MinIO assets and all.

What it does

Six idempotent steps:

  1. Scaffold .env from .env.example if missing
  2. Run composer install via docker (no PHP needed on host)
  3. Write FP_S3_DISABLED=0 to .env so uploads land in MinIO (designer mental model matches prod) — unless operator already set FP_S3_DISABLED explicitly, in which case their choice wins
  4. docker compose up -d --wait — gates on healthchecks
  5. wp core install if WP isn't installed yet (defaults admin / admin / admin@example.test, override via [init] in frankenpress.toml)
  6. Apply the latest snapshot by manifest.created — same logic the chart's install Job uses on cluster deploy, so local + in-cluster apply target the same source of truth

Every step is independently idempotent: .env scaffold no-ops if .env exists, composer install no-ops if vendor/ exists, the FP_S3_DISABLED line is appended only if absent, wp core install no-ops if WP is already installed, apply hits the mu-plugin's idempotency markers. Re-running is safe and cheap.

Flags

Flag Effect
--slug <s> Override the most-recent-snapshot pick.
--skip-setup Skip ALL env-mutating steps (.env scaffold + composer + FP_S3_DISABLED line). For CI / scripted setups.
--no-apply Bring stack up + install WP, skip apply.
--reinstall-wp Drop existing WP install (default off).
--service / --project Standard compose overrides.

Config

New [init] section in frankenpress.toml (all optional):

[init]
site_title     = "FrankenPress site"
admin_user     = "admin"
admin_password = "admin"
admin_email    = "admin@example.test"
disable_s3     = false    # true to keep FP_S3_DISABLED=1 locally

Tradeoff

Designer-mode S3 (FP_S3_DISABLED=0) means wp-admin's "Install plugin / theme from zip" buttons don't work — the s3:// stream wrapper doesn't support every ZipArchive op. Designers rarely need that path; if you do, set FP_S3_DISABLED=1 in .env and re-run fp init (operator-choice preservation makes this stick), or use composer require wpackagist-plugin/<slug> (the FrankenPress canonical install path).

Under the hood

  • docker.Runner grows three methods: ComposeUp, ComposeBuild, ComposerInstall. Each has a recorded-call Fake for unit tests.
  • apply.PickLatest() (shipped in v0.5.0) is reused for the snapshot pick — fp init and fp apply (no arg) share semantics so they can't drift.
  • New internal/setup/ package: pure file-IO helpers (ScaffoldEnvFromExample, EnsureEnvKey, ReadEnvKey) + the orchestrator.
  • 91 unit tests across 17 packages; vet + lint clean.

Upgrading

brew upgrade fp
fp version  # → v0.6.0
fp init --help

Docs PR: frankenpress/docs#45. Full design rationale: workspace .aidocs/fp-init.md.

Full diff

#10