Make sure all dependencies have been installed before moving on:
- Ansible >= 2.0.0.2
- Virtualbox >= 4.3.10
- Vagrant >= 1.5.4
- vagrant-bindfs >= 0.3.1 (Windows users may skip this if not using vagrant-winnfsd for folder sync)
- vagrant-hostmanager
Create a recommended structure for trellis
myexample.com/ # → Root folder for the project
├── trellis/ # → Your clone of this repository
└── mysite/ # → A Bedrock-based WordPress site
└── web/
├── app/ # → WordPress content directory (themes, plugins, etc.)
└── wp/ # → WordPress core (don't touch!)
by doing...
1- Create a new project directory named myexample.com
:
mkdir myexample.com && cd myexample.com
2- Clone Trellis to a trellis
folder:
git clone --depth=1 [email protected]:roots/trellis.git && rm -rf trellis/.git
3- Clone Bedrock to a mysite
folder:
git clone --depth=1 [email protected]:roots/bedrock.git mysite && rm -rf mysite/.git
4- Install the Ansible Galaxy roles:
cd trellis && ansible-galaxy install -r requirements.yml
These changes are based on the instructions at https://roots.io/trellis/docs/installing-trellis/
Customize the configuration files for setting the local development enviroment by doing (from trellis
directory)
curl -# -SL https://git.io/vVzap | bash -s myexample
This command does some changes at the following files:
group_vars/all/users.yml
group_vars/development/vault.yml
group_vars/development/wordpress_sites.yml
These changes are based on the instructions at:
w/ some modifications on my own to solve some issues i've found in the way
Launch the virtual machine (from trellis
directory) with
vagrant up
and visit the main site of the wordpress network at http://myexample.local
Log in with admin:admin
and create a new site in the network called test.myexample.local
Add manually the following line to /etc/hosts
192.168.50.5 test.myexample.local
Or just do (to add it automatically) from trellis
directory
curl -# -SL https://git.io/vVzpH | bash -s test
Visit the new site of the network at http://test.myexample.local
Download local .zip
files, set composer.json
and install dependencies (plugins and themes) by doing (from site
directory)
curl -# -SL https://git.io/vVzpy | bash