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: - **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: ```sh 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 ```