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 512MB droplet.
You can view it at https://rootsbase.s13.io/.
Make sure you have installed all of the dependencies for Bedrock and Sage before moving on.
At a minimum you need to have:
Here's how this example project was created:
- Create a new project directory:
$ mkdir example.com && cd example.com
- Clone Bedrock:
$ git clone --depth=1 git@github.com:roots/bedrock.git site && rm -rf site/.git
- Clone Sage:
$ git clone --depth=1 --branch sage-9 git@github.com:roots/sage.git site/web/app/themes/sage && rm -rf site/web/app/themes/sage/.git
Here are the steps to get started on a Ubuntu / Debian installation:
- 'apt-get install git'
- 'apt-get install node'
- 'apt-get install npm'
- 'npm install composer'
- 'npm install yarn'
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!)
- Clone this repository into a working directory (e.g.,
/Applications/MAMP/htdocs
)
$ git clone git@github.com:spot13/rootsbase.git
- Install composer packages
<<<<<<< Local Changes
# @ roots-example-project.com/site
$ composer install -o --prefer-dist --no-interaction
=======
# @ rootsbase.com/site
$ composer install
>>>>>>> External Changes
- Install theme components
# @ rootsbase/site/web/app/themes/sage
$ composer install
$ yarn install
- **Create a new host in MAMP and point it to your web directory
@ rootsbase.com/site/web
start the web server and mysql
- Test the install at rootsbase.dev
# @ rootsbase.com/trellis
$ ansible-playbook server.yml -e env=<environment>
# @ rootsbase.com/trellis
./deploy.sh <environment> rootsbase.com
# OR
ansible-playbook deploy.yml -e "site=rootsbase.com env=<environment>"
To rollback a deploy:
ansible-playbook rollback.yml -e "site=rootsbase.com env=<environment>"
In development, run gulp in watch mode for live updates at localhost:3000. Important: always use the rootsbase.dev URL to access the WordPress admin.
# @ rootsbase.com/site/web/app/themes/sage
$ gulp watch
Production assets (minified CSS, JavaScript, images, fonts, etc.) need to be compiled. Run gulp with the --production
flag. The resulting files will be saved in themes/sage/dist/
. Never edit files in the dist
directory.
# @ rootsbase.com/site/web/app/themes/sage
$ gulp --production
Contributions are welcome from everyone. We have contributing guidelines to help you get started.
Keep track of development and community news.
- Participate on the Roots Discourse
- Follow @rootswp on Twitter
- Read and subscribe to the Roots Blog
- Subscribe to the Roots Newsletter
- Listen to the Roots Radio podcast