0.1.0 • Published 8 months ago
wordpress-setup v0.1.0
wordpress-setup
A tool for setting up a modern, developer-friendly WordPress development environment.
Usage
- Set up a config file:
wpsu.config.js
export default {
locations: [{
src: 'myTheme',
dest: 'wp-content/themes/yourTheme'
}, {
src: 'myPlugin',
dest: 'wp-content/plugins/myPlugin'
}],
infra: {
production: {
base_url: 'mywordpressblog.com'
server: {
user: 'sshUsername',
password: 'sshPassword',
host: 'sshHost',
path: '/the/path/to/your/wordpress/root/www',
private_key_file: '/path/to/your/ssh/pk/file'
},
database: {
host: 'dbHost',
user: 'dbUser',
password: 'dbPassword',
name: 'dbName',
credentials_file: '/path/to/remote/cred/file'
}
},
test: {
base_url: 'test.mywordpressblog.com',
server: {}, // same structure as the production env
database: {}, // same structure as the production env
},
local: {
base_url: 'localhost:1234' // The URL you locally want to develop on
}
}
}
Use .env files (
process.env
) for secrets
npx wpsu pull
: pulls all web files and a DB dump from theproduction
server into a directorywp-YYYYMMDDHHMMSS
To set up a local dev server
npx wpsu setup-docker
docker compose up
To set up a remote test environment
npx wpsu push-db
npx wpsu push-web
0.1.0
8 months ago