Stars: 466
Forks: 175
Pull Requests: 53
Issues: 40
Watchers: 51
Last Updated: 2022-02-12 10:41:02
Example Roots stack project (Trellis, Bedrock, Sage)
License:
Languages: Shell, PHP, JavaScript, CSS, Ruby, Python, HTML
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/.
Make sure you have installed all of the dependencies for Trellis, Bedrock and Sage before moving on.
At a minimum you need to have:
See our Getting Started docs:
Here's how this example project was created:
$ mkdir example.com && cd example.com
$ git clone --depth=1 [email protected]:roots/trellis.git && rm -rf trellis/.git
$ composer create-project roots/bedrock site
$ composer create-project roots/sage site/web/app/themes/sage
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!)
~/Sites
)$ git clone [email protected]:roots/roots-example-project.com.git
# @ roots-example-project.com/site/web/app/themes/sage
$ composer install
$ yarn && yarn build
# @ roots-example-project.com/trellis
$ vagrant up
Note: to shut down the server: vagrant halt
# @ 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>"
In development, run yarn start
for live updates at localhost:3000. Important: always use the roots-example-project.test URL to access the WordPress admin.
# @ roots-example-project.com/site/web/app/themes/sage
$ yarn start
Production assets (minified CSS, JavaScript, images, fonts, etc.) need to be compiled. Run yarn build:production
. The resulting files will be saved in themes/sage/dist/
. Never edit files in the dist
directory.
# @ 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.