spot13 / rootsbase

Example Roots stack project (Bedrock, Sage)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 512MB droplet.

You can view it at https://rootsbase.s13.io/.

Requirements

Make sure you have installed all of the dependencies for Bedrock and Sage before moving on.

At a minimum you need to have:

Instructions

Here's how this example project was created:

  1. Create a new project directory: $ mkdir example.com && cd example.com
  2. Clone Bedrock: $ git clone --depth=1 git@github.com:roots/bedrock.git site && rm -rf site/.git
  3. 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:

  1. 'apt-get install git'
  2. 'apt-get install node'
  3. 'apt-get install npm'
  4. 'npm install composer'
  5. '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!)

Local development setup

  1. Clone this repository into a working directory (e.g., /Applications/MAMP/htdocs)
$ git clone git@github.com:spot13/rootsbase.git
  1. Install composer packages
<<<<<<< Local Changes
# @ roots-example-project.com/site
$ composer install -o --prefer-dist --no-interaction
=======
# @ rootsbase.com/site
$ composer install
>>>>>>> External Changes
  1. Install theme components
# @ rootsbase/site/web/app/themes/sage
$ composer install
$ yarn install
  1. **Create a new host in MAMP and point it to your web directory

@ rootsbase.com/site/web

start the web server and mysql

  1. Test the install at rootsbase.dev

Remote server setup (staging/production)

Provision server:

# @ rootsbase.com/trellis
$ ansible-playbook server.yml -e env=<environment>

Deploy:

# @ 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>"

Theme development

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

Contributing

Contributions are welcome from everyone. We have contributing guidelines to help you get started.

Community

Keep track of development and community news.

About

Example Roots stack project (Bedrock, Sage)


Languages

Language:PHP 65.6%Language:JavaScript 16.3%Language:CSS 16.1%Language:HTML 2.0%