Template repo for new Wordpress projects
Go to file Use this template
2024-05-15 22:44:36 -03:00
.gitea More templating 2024-05-15 22:44:36 -03:00
data Initial cut 2024-05-09 16:03:43 -03:00
wp-content Add empty wp-content for clarity 2024-05-15 21:54:59 -03:00
.drone.yml More templating 2024-05-15 22:44:36 -03:00
.env.sample Skip composer installation unless requested 2024-05-15 22:32:59 -03:00
.gitignore Switch to ignoring only built-in Wordpress themes 2024-05-15 21:54:22 -03:00
docker-compose.yml Make Mailhog actually work 2024-05-15 22:25:37 -03:00
entrypoint.sh Skip composer installation unless requested 2024-05-15 22:32:59 -03:00
mailhog-smtp.php Skip composer installation unless requested 2024-05-15 22:32:59 -03:00
makefile Initial cut 2024-05-09 16:03:43 -03:00
README.md Tweak docs 2024-05-15 21:55:50 -03:00

A template for Autonomic Wordpress projects, including local set-up, and auto-deployment.

To use it:

  1. Make a new repository, using this as a template
  2. Remove this notice from README.md (everything until the ---)
  3. Create and deploy a Co-op Cloud Wordpress app
  4. Edit .env.sample to set SITE_URL (and customise PROJECT_NAME, if needed)
  5. Make sure .drone.yml has the right settings for the server you'd like to deploy to
  6. Add any custom plugins / themes to wp-content
  7. "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:

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