Roots Example Project
This repository is an example of how to integrate and use the following projects together:
For more background, see this blog post.
This project is a complete working example that's deployed on a Digital Ocean $5 droplet.
You can view it at https://roots-example-project.com/.
At a minimum you need to have:
See our Getting Started docs:
- Development Environment Recommendations
- macOS Basic Setup
- macOS Development Environment: Sage
- macOS Development Environment: Trellis
- Ubuntu Linux Basic Setup
- Ubuntu Linux Development Environment: Sage
- Ubuntu Linux Development Environment: Trellis
- Windows Basic Setup
- Windows Development Environment: Sage
- Windows Development Environment: Trellis
Here's how this example project was created:
- Create a new project directory:
$ mkdir example.com && cd example.com
- Clone Trellis:
$ git clone --depth=1 email@example.com:roots/trellis.git && rm -rf trellis/.git
- Clone Bedrock:
$ composer create-project roots/bedrock site
- Install Sage:
$ composer create-project roots/sage site/web/app/themes/sage
- During theme setup, specify "https://roots-example-project.test" as the "Local development URL"
example.com/ # → Root folder for the project ├── trellis/ # → System management & deployment └── site/ # → A Bedrock-based WordPress site └── web/ ├── app/ # → WordPress content directory (themes, plugins, etc.) └── wp/ # → WordPress core (don't touch!)
Local development setup
- Clone this repository into a working directory (e.g.,
$ git clone firstname.lastname@example.org:roots/roots-example-project.com.git
- Install theme components
# @ roots-example-project.com/site/web/app/themes/sage $ composer install $ yarn && yarn build
- Fire up the server (be patient, but watch the console––it may prompt for your system password)
# @ roots-example-project.com/trellis $ vagrant up
Note: to shut down the server:
- Test the install at roots-example-project.test
Remote server setup (staging/production)
# @ roots-example-project.com/trellis $ ansible-playbook server.yml -e env=<environment>
# @ roots-example-project.com/trellis ./deploy.sh <environment> roots-example-project.com # OR ansible-playbook deploy.yml -e "site=roots-example-project.com env=<environment>"
To rollback a deploy:
ansible-playbook rollback.yml -e "site=roots-example-project.com env=<environment>"
# @ roots-example-project.com/site/web/app/themes/sage $ yarn start
yarn build:production. The resulting files will be saved in
themes/sage/dist/. Never edit files in the
# @ roots-example-project.com/site/web/app/themes/sage $ yarn build:production
Contributions are welcome from everyone. We have contributing guidelines to help you get started.
Keep track of development and community news.