Vagrant/Drupalvm enabled Drupal 8 Framework.
This repository is configured to be run on an Ubuntu 16.04 virtual machine powered by Vagrant.
- Vagrant
- Access to github repository
- Patience
- Clone this repo on your machine
- Copy
docroot/sites/default/dv.settings.local.php
todocroot/sites/default/settings.local.php
- Get
dv_credentials.json
from a peer and place it in default directory. The path of the file should bedocroot/sites/default/dv_credentials.json
- From any directory, run
vagrant up
. First time set up may take 15-20 minutes but subsequent provisioning will be lot faster. - Once done, go to
http://local.dvvm.dvdev.net
and start building :)
C1. Login inside VM - vagrant ssh
C2. Clear drupal cache from commandline - C1 + drush cr
C3. Add linux packages to VM for testing (like upgrading PHP) - C1 + apt install <package name>
C4. Reset/Provision VM - vagrant reload --provision
C5. Destroy VM - vagrant destroy
C6. Suspend VM temporarily(sometimes to save resources on physical machine) - vagrant halt
Method A (Import database only):
vagrant ssh
dv.db.sandbox <sandbox name>
e.g.dv.db.sandbox pr123
Note:- If no<sandbox name>
is provided, database will be imported fromdevelop
sandbox.
Method B (Import database and provision VM):
SBOX=<sandbox name> vagrant reload --provision
To be done.
- Open
docroot/sites/default/settings.local.php
with text editor of your choice. - Set
$testing
and$remote_testing
to TRUE - Set
$sandbox
to name of the sandbox e.g. develop or pr261 - Run
drush cr
inside VM to clear cache if there is any error. If error persists, check your VPN connection.
If you are testing features on local, you may want to disable dev tools, debug etc and enable Drupal caching and memcached to replicate production to and extent. To do so, change $testing
in docroot/sites/default/settings.local.php
to TRUE.
Note:- Keep $remote_testing
to FALSE.
- Ensure settings.local.php and dv_credentials.json exist in
sites/default
directory.
- Vagrant machine configuration can be modified at
.drupalvm/config.yml
. For all configurable settings, refer.drupalvm/default.config.yml
(but do not modify this file). - Vhosts can be changed in
.drupalvm/config.yml
by changing theproject_name
on line 1. Only use lowercase names without any special characters and spaces. This will spin up "http://local.projectname.dvdev.net".
- Clone this repo. Run
git clone [email protected]:fotuzlab/dvvm.git
- Delete .git directory. Run
rm -rf .git
- Replace files under docroot with files of your project. composer.json defaults to drupal 8 setup. You may need to modify based on drupal version of your project.
- Run
composer update && composer install
- Run
git init
to initialise git. - Run
git remote add origin <ssh url of github repo>
- Run
git add . && git commit -am "Initial commit" && git push origin master
- Run
git checkout -b develop && git push origin develop
. Develop serves as the active development branch. - Get the vm up and running. Run
vagrant up
.