CI/CD Integration
loopress/setup-ci starts MySQL and WordPress via Docker, installs WP-CLI, creates the REST credentials, and installs the Loopress CLI. Your pipeline can run lps snippet push immediately after.
How it works
Section titled “How it works”- Starts MySQL 8 and WordPress via Docker Compose
- Waits for WordPress to respond (up to 90 seconds)
- Installs WP-CLI inside the WordPress container
- Runs
wp core installand creates an application password - Exports a clean database snapshot so you can reset back to it later between groups of tests, see each platform’s “Restoring between groups of tests” section
- Writes
$XDG_CONFIG_HOME/loopress/config.json(or~/.config/loopress/config.json) with the site credentials - Installs
@loopress/cli
Token requirements
Section titled “Token requirements”No token is needed to run lps snippet push or lps plugin push against a local WordPress instance.
A token is required only when deploying to a real site. Get one at console.loopress.dev/tokens.
Deploying to a real environment
Section titled “Deploying to a real environment”The ephemeral instance above is for tests. To deploy to a real site (staging, production), provide the project configuration as a CI secret and pick the environment per command with --env, instead of fabricating the active-environment state in the config file:
- Configure the project once on your machine (
lps project config). - Store your
config.json(see its path under “How it works”) as a CI secret file, and setLOOPRESS_TOKEN. - Target the environment explicitly in the pipeline:
lps doctor --env staginglps snippet push --env staging --yes--env targets an environment by name and does not depend on which environment was last active. --yes answers confirmations; pushing to an environment named production requires it in a non-interactive run.
Supported platforms
Section titled “Supported platforms”Beyond syncing files
Section titled “Beyond syncing files”loopress/setup-ci boots a real WordPress instance, not a mock, so you can also drive it with a browser to test actual site behaviour. See E2E Testing for running Playwright against it with WordPress’s own @wordpress/e2e-test-utils-playwright helpers.
Full example
Section titled “Full example”github.com/loopress/demo is a small but complete reference project: loopress.json, versioned snippets, CI wired up on both GitHub Actions and GitLab CI, and a Playwright E2E suite.