Creating a new Wordpress x Lando Project
If you'd like to skip setup, you can always clone our kalapress pro as a starting point.
Get started configuring Wordpress with Lando.
Note: the command in the getting started with Lando guide assumes you are at the root of your project. Create a directory and initialize git first. You will also need a .gitignore.
Setting up a Wordpress x Lando Project Locally
For the most part, setting up a local wordpress instance with lando is as easy as cloning and running lando start
.
Downloading a Database
Oftentimes, pulling a database for your local lando install is important. This can be as easy as running lando pull
on select project but this isn't always an option.
Download the .sql backup from the host. (Ensure it is unzipped)
Backups in WPEngine can be found in the installation you need a backup of under ‘Backup Points’
Search and replace the base url of the instance with your local base url
sed -i 's|https:\/\/wavelengthmusic\.ca|https:\/\/wav-test\.lndo\.site|g' wp_wavelengthto.sql
Import with
lando db-import <db.sql>
Wordpress and Circle CI
With our current setup, most of our Wordpress sites go through circle CI and simply have their wp-content directory rsync'ed to the WPEngine instance.
Here is how to create a circle CI config.
Setting up Wordpress with circle CI for WPEngine.
Otherwise, here is the CI configuration that kalapress pro uses:
version: 2 composer config -g github-oauth.github.com a5c3af2e7715f035ec4715acd60e18650baa3bf7 jobs: build-and-deploy-dev: docker: - image: circleci/php:7.4-node-browsers working_directory: ~/repo steps: - checkout - run: command: npm install working_directory: wordpress/wp-content/themes/kalamunastarter/ -run: command: composer install --prefer-dist --no-dev -o working_directory: wordpress/wp-content/themes/kalamunastarter/ - run: ssh-keyscan -p 2222 -H <host> >> ~/.ssh/known_hosts - run: sudo apt install rsync - run: rsync -rLvz --exclude-from='./.circleci/rsync-exclude-file.txt' --size-only --checksum --ipv4 --progress -e 'ssh -p 2222' ./wordpress/wp-content/. --temp-dir=~/tmp/ <user>@<host>:code/ workflows: version: 2 build_and_deploy_dev: jobs: - build-and-deploy-dev: filters: branches: only: development