Changeset 60431
- Timestamp:
- 07/07/2025 11:30:25 PM (8 days ago)
- Location:
- branches/6.8
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/6.8
-
branches/6.8/docker-compose.yml
r60092 r60431 107 107 PHP_FPM_GID: ${PHP_FPM_GID-1000} 108 108 HOST_PATH: ${PWD-}/${LOCAL_DIR-src} 109 WP_CONFIG_PATH: /var/www/wp-config.php 109 110 110 111 volumes: -
branches/6.8/tools/local-env/scripts/install.js
r59769 r60431 1 /* jshint node:true */ 2 1 3 const dotenv = require( 'dotenv' ); 2 4 const dotenvExpand = require( 'dotenv-expand' ); 3 5 const wait_on = require( 'wait-on' ); 4 6 const { execSync } = require( 'child_process' ); 5 const { re nameSync, readFileSync, writeFileSync } = require( 'fs' );7 const { readFileSync, writeFileSync } = require( 'fs' ); 6 8 const { utils } = require( './utils.js' ); 7 9 const local_env_utils = require( './utils' ); … … 13 15 14 16 // Create wp-config.php. 15 wp_cli( 'config create --dbname=wordpress_develop --dbuser=root --dbpass=password --dbhost=mysql --force');17 wp_cli( `config create --dbname=wordpress_develop --dbuser=root --dbpass=password --dbhost=mysql --force --config-file=${process.env.LOCAL_DIR}/../wp-config.php` ); 16 18 17 19 // Add the debug settings to wp-config.php. … … 24 26 wp_cli( `config set WP_DEVELOPMENT_MODE ${process.env.LOCAL_WP_DEVELOPMENT_MODE} --type=constant` ); 25 27 26 // Move wp-config.php to the base directory, so it doesn't get mixed up in the src or build directories.27 renameSync( `${process.env.LOCAL_DIR}/wp-config.php`, 'wp-config.php' );28 29 28 // Read in wp-tests-config-sample.php, edit it to work with our config, then write it to wp-tests-config.php. 30 29 const testConfig = readFileSync( 'wp-tests-config-sample.php', 'utf8' ) … … 33 32 .replace( 'yourpasswordhere', 'password' ) 34 33 .replace( 'localhost', 'mysql' ) 35 .replace( "'WP_TESTS_DOMAIN', 'example.org'", `'WP_TESTS_DOMAIN', '${process.env.LOCAL_WP_TESTS_DOMAIN}'` )36 .concat( "\ndefine( 'FS_METHOD', 'direct' );\n");34 .replace( `'WP_TESTS_DOMAIN', 'example.org'`, `'WP_TESTS_DOMAIN', '${process.env.LOCAL_WP_TESTS_DOMAIN}'` ) 35 .concat( `\ndefine( 'FS_METHOD', 'direct' );\n` ); 37 36 38 37 writeFileSync( 'wp-tests-config.php', testConfig ); 39 38 40 39 // Once the site is available, install WordPress! 41 wait_on( { resources: [ `tcp:localhost:${process.env.LOCAL_PORT}`] } ) 40 wait_on( { 41 resources: [ `tcp:localhost:${process.env.LOCAL_PORT}`], 42 timeout: 3000, 43 } ) 44 .catch( err => { 45 console.error( `Error: It appears the development environment has not been started. Message: ${ err.message }` ); 46 console.error( `Did you forget to do 'npm run env:start'?` ); 47 process.exit( 1 ); 48 } ) 42 49 .then( () => { 43 50 wp_cli( 'db reset --yes' ); 44 51 const installCommand = process.env.LOCAL_MULTISITE === 'true' ? 'multisite-install' : 'install'; 45 52 wp_cli( `core ${ installCommand } --title="WordPress Develop" --admin_user=admin --admin_password=password --admin_email=test@test.com --skip-email --url=http://localhost:${process.env.LOCAL_PORT}` ); 53 } ) 54 .catch( err => { 55 console.error( `Error: Unable to reset DB and install WordPress. Message: ${ err.message }` ); 56 process.exit( 1 ); 46 57 } ); 47 58
Note: See TracChangeset
for help on using the changeset viewer.