Note: This is pre-built setup for demo.
If you want to add Drupal VM to your projects via composer, use the following steps.
First you need to install composer.
Note: The instructions below refer to the global composer installation. You might need to replace
composer
withphp composer.phar
(or similar) for your setup.
After that you can create the project:
composer create-project drupal-composer/drupal-project:8.x-dev some-dir --stability dev --no-interaction
With composer require ...
you can download new dependencies to your
installation.
cd some-dir
composer require drupal/devel:~1.0
The composer create-project
command passes ownership of all files to the
project that is created. You should create a new git repository, and commit
all files not excluded by the .gitignore file.
Second Command is to add drupal vm via composer
cd some-dir
composer require --dev geerlingguy/drupal-vm
This will add Drupal VM to your project. You can check by visiting some-dir/vendor/geerlingguy
directory.
- config.yml allows various attributes and tools that are required for project.
You can use
config.yml
from this project or can create your own. - To create your own
config.yml
- Goto
some-dir/vendor/geerlingguy/drupal-vm
. - Copy
default.configy.yml
and paste it tosome-dir/vm/config.yml
Note that, you will need to createvm
directory in your project root. - Modify all the settings in
config.yml
as per your requirement.
- Goto
- Create delegating file called
Vagrantfile
, which will tell Vagrant about where it should find Drupal VM, config.yml and other required files. - Ignore vagrant files, because they are not supposed to be committed in repo. You can add this to your
.gitignore
-
# Ignore Vagrant related files and folders. .vagrant/
-
- Once these files are created, you are good to use vagrant. Run following commands.
- Composer install
- vagrant up
- Note: Make sure that you have installed all the required dependencies for vagrant and drupal vm. You can check that on Drupal VM project page.
- To perform drupal related changes like adding module, theme, patches etc. you can refer README file for Drupal Composer project template's readme file.