You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 13, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,6 +83,8 @@ Notes:
83
83
4. Open Terminal, `cd` to this directory (containing the `Vagrantfile` and this README file).
84
84
5. Type in `vagrant up`, and let Vagrant do its magic.
85
85
86
+
Once the process is complete, you will have a Drupal codebase available inside the `drupal/` directory of the project.
87
+
86
88
Note: *If there are any errors during the course of running `vagrant up`, and it drops you back to your command prompt, just run `vagrant provision` to continue building the VM from where you left off. If there are still errors after doing this a few times, post an issue to this project's issue queue on GitHub with the error.*
87
89
88
90
### 3 - Configure your host machine to access the VM.
Copy file name to clipboardExpand all lines: docs/deployment/composer.md
+10-18Lines changed: 10 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,23 +3,23 @@ Drupal VM is configured to use `composer create-project` to build a Drupal 8 cod
3
3
## Using composer.json
4
4
5
5
1. Copy `example.drupal.composer.json` to `drupal.composer.json` and modify it to your liking.
6
-
2. Use the Composer build system by setting `build_composer: true` in your `config.yml` (make sure `build_makefile`is set to `false`).
6
+
2. Use the Composer build system by setting `build_composer: true` in your `config.yml` (make sure `build_makefile`and `build_composer_project` are set to `false`).
7
7
3. Configure `drupal_core_path` to point to the webroot directory: `drupal_core_path: {{ drupal_composer_install_dir }}/docroot`
_The file set in `drupal_composer_path` (which defaults to `drupal.composer.json`) will be copied from your host computer into the VM's `drupal_composer_install_dir` and renamed `composer.json`. If you already have a composer.json within that directory, you can set `drupal_composer_path: false`._
15
+
_The file set in `drupal_composer_path` (which defaults to `drupal.composer.json`) will be copied from your host computer into the VM's `drupal_composer_install_dir` and renamed `composer.json`. If you already have a composer.json within that directory, set `drupal_composer_path: false`._
16
16
17
17
## Using Composer when [Drupal VM is a composer dependency itself](../other/drupalvm-composer-dependency.md)
18
18
19
-
In the scenario where you already have an existing `composer.json` in the root of your project, follow the usual steps for installing with a composer.json but instead of creating a `drupal.composer.json` file, disable the transfering of the file by setting `drupal_composer_path` to `false`, and change `drupal_composer_install_dir` to point to the the directory where it will be located. If `drupal_composer_path` is not truthy, Drupal VM assumes it already exists.
19
+
In the scenario where you already have an existing `composer.json` in the root of your project, follow the usual steps for installing with a composer.json but instead of creating a `drupal.composer.json` file, disable the transfering of the file by setting `drupal_composer_path: false`, and change `drupal_composer_install_dir` to point to the the directory where it will be located. If `drupal_composer_path` is not truthy, Drupal VM assumes it already exists.
20
20
21
21
```yaml
22
-
build_makefile: false
22
+
build_composer_project: false
23
23
build_composer: true
24
24
drupal_composer_path: false
25
25
drupal_composer_install_dir: "/var/www/drupalvm"
@@ -33,22 +33,14 @@ This is the default Drupal VM build configuration, set up by the following setti
33
33
- Composer will build the project if `build_composer_project` is `true`, and `build_makefile` and `build_composer` are both `false`.
34
34
- The Composer package is defined by `drupal_composer_project_package`.
35
35
- Adjust the create-project CLI options in `drupal_composer_project_options` as well as add additional dependencies in `drupal_composer_dependencies`.
36
-
- Ensure that the webroot configured in the Composer package matches the one set in `drupal_core_path`.
36
+
- Ensure that the webroot configured in the Composer package matches the one set in `drupal_core_path`. The default is set to `web/`.
37
37
38
-
With [drupal-composer/drupal-project](https://github.com/drupal-composer/drupal-project) as an example your `config.yml` settings would be:
38
+
With [acquia/lightning-project](https://github.com/acquia/lightning-project) as an example your `config.yml` settings would be:
Drupal VM is configured to use Composer by default to build a Drupal site on the VM inside `/var/www/drupalvm/drupal` (in a folder that's synced to your local machine, so you can work with the Drupal codebase either locally or inside the VM).
1
+
Drupal VM is configured to use Composer by default to build a Drupal site on the VM inside `/var/www/drupalvm/drupal/web` (in a folder that's synced to your local machine, so you can work with the Drupal codebase either locally or inside the VM).
2
2
3
-
If you want to build a Drupal site using a [Drush make file](http://www.drush.org/en/master/make/) instead, you can either use the `example.drupal.make.yml` file as a base, or use your own Drush make file: just place it or symlink it into the root of the Drupal VM folder with the filename `drupal.make.yml`. You can also set a separate path to the makefile using the `drush_makefile_path` variable.
3
+
If you want to build a Drupal site using a [Drush make file](http://www.drush.org/en/master/make/) instead, set `build_composer_project: false`, `build_makefile: true` and either use the `example.drupal.make.yml` file as a base, or use your own Drush make file: just place it or symlink it into the root of the Drupal VM folder with the filename `drupal.make.yml`. You can also set a separate path to the makefile using the `drush_makefile_path` variable.
4
+
5
+
```yaml
6
+
build_composer_project: false
7
+
build_makefile: true
8
+
```
4
9
5
10
Have a look at the defaults in `default.config.yml` and tweak the settings as you'd like in your `config.yml`, then run `vagrant up` as in the Quick Start Guide. Within a few minutes, you should have your site running and available at the `drupal_domain` configured in `config.yml`, falling back to the default `http://drupalvm.dev` set in `default.config.yml`.
11
+
12
+
With the default settings the Drupal site will be built on the VM inside `/var/www/drupalvm/drupal/web` but the `web/` subdirectory is only required for `composer` based projects and you can simplify this directory structure by setting `drupal_core_path` to `/var/www/drupalvm/drupal`.
Copy file name to clipboardExpand all lines: docs/other/drupalvm-composer-dependency.md
+11-3Lines changed: 11 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,9 +15,9 @@ Add and configure the `config.yml` anywhere you like, in this example we place i
15
15
_Note: This will be the directory where Drupal VM looks for other local configuration files as well. Such as [`local.config.yml` and `Vagrantfile.local`](overriding-configurations.md)._
16
16
17
17
```
18
+
├── composer.json
18
19
├── config/
19
20
│ ├── config.yml
20
-
│ ├── drupal.make.yml
21
21
│ ├── local.config.yml
22
22
│ └── Vagrantfile.local
23
23
├── docroot/
@@ -29,6 +29,16 @@ _Note: This will be the directory where Drupal VM looks for other local configur
29
29
└── drupal-vm/
30
30
```
31
31
32
+
Change the build strategy to use your `composer.json` file by setting:
If you're using `pre_provision_scripts` or `post_provision_scripts` you also need to adjust their paths to take into account the new directory structure. The examples used in `default.config.yml` assume the files are located in the Drupal VM directory. If you use relative paths you need to the ascend the directory tree as far as the project root, but using the `config_dir` variable you get the absolute path of where you `config.yml` is located.
33
43
34
44
```yaml
@@ -66,7 +76,6 @@ Your project structure should now look like this:
66
76
├── composer.json
67
77
├── config/
68
78
│ ├── config.yml
69
-
│ ├── drupal.make.yml
70
79
│ ├── local.config.yml
71
80
│ └── Vagrantfile.local
72
81
├── docroot/
@@ -117,7 +126,6 @@ Your directory structure should now look like this:
0 commit comments