Skip to content
This repository was archived by the owner on Feb 13, 2023. It is now read-only.

Commit 6174c63

Browse files
committed
revert to default drupal_core_path and add example.drupal.composer.json
1 parent f7f36c3 commit 6174c63

File tree

5 files changed

+14
-6
lines changed

5 files changed

+14
-6
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ env:
55
global:
66
- CONFIG: tests/config.yml
77
MAKEFILE: example.drupal.make.yml
8+
COMPOSERFILE: example.drupal.composer.json
89
HOSTNAME: drupalvm.dev
910
MACHINE_NAME: drupalvm
1011
IP: 192.168.88.88
@@ -57,6 +58,7 @@ script:
5758
# Copy configuration files into place.
5859
- 'sudo docker exec "$(cat ${container_id})" cp ${DRUPALVM_DIR}/${CONFIG} ${config_dir:-$DRUPALVM_DIR}/config.yml'
5960
- 'sudo docker exec "$(cat ${container_id})" cp ${DRUPALVM_DIR}/${MAKEFILE} ${config_dir:-$DRUPALVM_DIR}/drupal.make.yml'
61+
- 'sudo docker exec "$(cat ${container_id})" cp ${DRUPALVM_DIR}/${COMPOSERFILE} ${config_dir:-$DRUPALVM_DIR}/drupal.composer.json'
6062

6163
# Override configuration variables.
6264
- '[[ ! -z "${local_config}" ]] && sudo docker exec "$(cat ${container_id})" bash -c "cp ${DRUPALVM_DIR}/${local_config} ${config_dir:-$DRUPALVM_DIR}/local.config.yml" || true'

default.config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ install_site: true
5959

6060
# Settings for installing a Drupal site (if 'install_site:' is 'true').
6161
drupal_major_version: 8
62-
drupal_core_path: "{{ drupal_composer_install_dir }}/docroot"
62+
drupal_core_path: "{{ drupal_composer_install_dir }}"
6363
drupal_domain: "{{ vagrant_hostname }}"
6464
drupal_site_name: "Drupal"
6565
drupal_install_profile: standard

docs/deployment/composer.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ Drupal VM is configured to use [Drush make](drush-make.md) by default but suppor
22

33
## Using composer.json
44

5-
Add a `drupal.composer.json` next to your `config.yml` and switch the build system by setting `build_makefile: false` and `build_composer: true` in your `config.yml`. By default Drupal VM expects the Drupal code to be installed within a `docroot/` directory, if you use a different webroot directory, you need to adjust `drupal_core_path`.
5+
1. Copy `example.drupal.composer.json` to `drupal.composer.json` and modify it to your liking.
6+
2. Switch the build system by setting `build_makefile: false` and `build_composer: true` in your `config.yml`.
7+
3. Configure `drupal_core_path` to point to the webroot directory: `drupal_core_path: {{ drupal_composer_install_dir }}/docroot`
68

79
```yaml
810
build_makefile: false
911
build_composer: true
12+
drupal_core_path: "{{ drupal_composer_install_dir }}/docroot"
1013
```
1114
1215
_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`._
@@ -20,6 +23,7 @@ build_makefile: false
2023
build_composer: true
2124
drupal_composer_path: false
2225
drupal_composer_install_dir: "/var/www/drupalvm"
26+
drupal_core_path: "{{ drupal_composer_install_dir }}/docroot"
2327
```
2428

2529
## Creating a project from a composer package: `composer create-project`
@@ -29,7 +33,7 @@ There's a couple of things you need to configure in your `config.yml`:
2933
- Switch the build system by setting `build_makefile: false`, `build_composer: false` and `build_composer_project: true`.
3034
- Configure the composer package in `drupal_composer_project_package`.
3135
- Additionally you can adjust the create-project CLI options in `drupal_composer_project_options` as well as add additional dependencies in `drupal_composer_dependencies`.
32-
- Ensure that the webroot configured in the composer package matches the one set in `drupal_core_path`. The default is `docroot/`.
36+
- Ensure that the webroot configured in the composer package matches the one set in `drupal_core_path`.
3337

3438
With [drupal-composer/drupal-project](https://github.com/drupal-composer/drupal-project) as an example your `config.yml` overrides would be:
3539

tests/composer.json renamed to example.drupal.composer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "drupal-vm/travis-test",
2+
"name": "custom-project/drupal-vm",
33
"description": "",
44
"type": "project",
55
"license": "MIT",
@@ -18,7 +18,8 @@
1818
"require": {
1919
"composer/installers": "^1.0.20",
2020
"drupal-composer/drupal-scaffold": "^2.0.1",
21-
"drupal/core": "~8.0"
21+
"drupal/core": "~8.0",
22+
"drupal/devel": "8.*"
2223
},
2324
"minimum-stability": "dev",
2425
"prefer-stable": true,
@@ -32,3 +33,4 @@
3233
}
3334
}
3435
}
36+

tests/ubuntu-16-nginx.config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ drupalvm_webserver: nginx
44
# Test composer based installation.
55
build_makefile: false
66
build_composer: true
7-
drupal_composer_path: "{{ config_dir }}/../tests/composer.json"
7+
drupal_core_path: "{{ drupal_composer_install_dir }}/docroot"

0 commit comments

Comments
 (0)