Skip to content

Commit 81db60b

Browse files
Playground CLI: Add skipSqliteSetup flag for MySQL support (#97)
## Motivation for the change, related issues While investigating https://linear.app/a8c/issue/STU-60/studio-app-cannot-activate-wordpress-plugins-using-freemius-if-using we realized there isn't an existing way to test mounted sites that use MySQL. ## Implementation details The proposed change introduces a new CLI flag `--skipSqliteSetup` that allows mounting a site using MySQL. ## Testing Instructions (or ideally a Blueprint) 1. Create a local site that is using MySQL. You can create a fresh Studio site and then follow these steps: https://developer.wordpress.com/docs/developer-tools/studio/frequently-asked-questions/#use-studio-with-mysql-server. 2. Once the site is ready, run bun command with the `--skipSqliteSetup` flag included. You can use the following example as a base: ``` bun ~/a8c/wordpress-playground-private/packages/playground/cli/src/cli.ts server --mountBeforeInstall=/Users/ivanottinger/Studio/0-db-new-test:/wordpress --port=9401 --skipWordPressSetup --skipSqliteSetup --php=8.4 ``` 3. Open the provided local site URL. It should load your Studio site that runs on MySQL as opposed to SQLite. 4. If the command is run without the flag, the site should load with the default SQLite DB. --------- Co-authored-by: Bero <[email protected]>
1 parent a4fca31 commit 81db60b

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

packages/playground/cli/src/cli.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ async function run() {
8080
type: 'boolean',
8181
default: false,
8282
})
83+
.option('skipSqliteSetup', {
84+
describe:
85+
'Skip the SQLite integration plugin setup to allow the WordPress site to use MySQL.',
86+
type: 'boolean',
87+
default: false,
88+
})
8389
.option('quiet', {
8490
describe: 'Do not output logs and progress messages.',
8591
type: 'boolean',

packages/playground/cli/src/run-cli.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export interface RunCLIArgs {
4343
port?: number;
4444
quiet?: boolean;
4545
skipWordPressSetup?: boolean;
46+
skipSqliteSetup?: boolean;
4647
wp?: string;
4748
}
4849

@@ -265,7 +266,9 @@ export async function runCLI(args: RunCLIArgs): Promise<RunCLIServer> {
265266
createPhpRuntime: async () =>
266267
await loadNodeRuntime(compiledBlueprint.versions.php),
267268
wordPressZip,
268-
sqliteIntegrationPluginZip: fetchSqliteIntegration(monitor),
269+
sqliteIntegrationPluginZip: args.skipSqliteSetup
270+
? undefined
271+
: fetchSqliteIntegration(monitor),
269272
sapiName: 'cli',
270273
createFiles: {
271274
'/internal/shared/ca-bundle.crt':

0 commit comments

Comments
 (0)