.gitea | ||
data | ||
wp-content | ||
.drone.yml | ||
.env.sample | ||
.gitignore | ||
docker-compose.yml | ||
entrypoint.sh | ||
mailhog-smtp.php | ||
makefile | ||
README.md |
A template for Autonomic Wordpress projects, including local set-up, and auto-deployment.
To use it:
- Make a new repository, using this as a template
- Remove this notice from
README.md
(everything until the---
) - Create and deploy a Co-op Cloud Wordpress app
- Edit
.env.sample
to setSITE_URL
(and customisePROJECT_NAME
, if needed) - Make sure
.drone.yml
has the right settings for the server you'd like to deploy to - Add any custom plugins / themes to
wp-content
- "Activate" this repository in Drone
$REPO_NAME
Wordpress local set-up and custom theme/plugins
Local development
Initial set-up
Install Docker (and, if your Docker version doesn't include docker compose
,
the separate docker-compose
programme).
Check out the code:
git clone $REPO_SSH_URL
cd $REPO_NAME
Copy the default environment file into place
cp .env.sample .env
Edit .env
as needed for your local config; read the descriptions for
DOCKER_SUDO
and DOCKER_COMPOSE
, and set them if you need to.
Then, download and start the Docker images:
make up # 💄
Download uploaded media (beware possibly-large filesize) and plugins from the live site:
make uploads_pull
make plugins_pull
Then fetch and load the database:
make db_pull set_local_password
If this process is interrupted for any reason but the database was downloaded in full, you can skip the dump/download process and just load the database and set the URL with:
make db_load fix_url
Lastly, install any parent themes in use on the site:
make theme_pull
The site should now be available:
- wordpress: http://$REPO_NAME.localhost/
- mailhog: http://$REPO_NAME.localhost:8025
Updating your local version
Run git pull
frequently.
Refresh from the live site as often as you can:
make plugins_pull theme_pull db_pull set_local_password
Running WPCLI commands
The make wp
shortcut doesn't support --flag
arguments, which are used in a
lot of wp
commands. As an alternative, a shell alias is provided:
source shell-aliases
wp post list --post_type page