Skip to content

Commit ad26127

Browse files
committed
Build/Test Tools: Don't run WP-CLI commands as root in the local development environment and CI environment.
Props johnbillion, westonruter. See #63167, #63564 git-svn-id: https://develop.svn.wordpress.org/trunk@60518 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 9156dc3 commit ad26127

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@
183183
"env:clean": "node ./tools/local-env/scripts/docker.js down -v --remove-orphans",
184184
"env:reset": "node ./tools/local-env/scripts/docker.js down --rmi all -v --remove-orphans",
185185
"env:install": "node ./tools/local-env/scripts/install.js",
186-
"env:cli": "node ./tools/local-env/scripts/docker.js exec cli wp --allow-root",
186+
"env:cli": "node ./tools/local-env/scripts/docker.js exec --user wp_php cli wp",
187187
"env:logs": "node ./tools/local-env/scripts/docker.js logs",
188188
"env:pull": "node ./tools/local-env/scripts/docker.js pull",
189189
"test:performance": "wp-scripts test-playwright --config tests/performance/playwright.config.js",

tools/local-env/scripts/install.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ local_env_utils.determine_auth_option();
1515
// Create wp-config.php.
1616
wp_cli( `config create --dbname=wordpress_develop --dbuser=root --dbpass=password --dbhost=mysql --force --config-file="wp-config.php"` );
1717

18-
// Since WP-CLI runs as root, the wp-config.php created above will be read-only. This needs to be writable for the sake of E2E tests.
19-
execSync( 'node ./tools/local-env/scripts/docker.js exec cli chmod 666 wp-config.php' );
20-
2118
// Add the debug settings to wp-config.php.
2219
// Windows requires this to be done as an additional step, rather than using the --extra-php option in the previous step.
2320
wp_cli( `config set WP_DEBUG ${process.env.LOCAL_WP_DEBUG} --raw --type=constant` );

0 commit comments

Comments
 (0)