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

Commit

Permalink
Issue #704: Fix some issues with Composer docs and add acquia/lightni…
Browse files Browse the repository at this point in the history
…ng-project as example
  • Loading branch information
oxyc committed Jun 6, 2016
1 parent 23f28df commit e1779d9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 19 deletions.
28 changes: 10 additions & 18 deletions docs/deployment/composer.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ Drupal VM is configured to use `composer create-project` to build a Drupal 8 cod
## Using composer.json

1. Copy `example.drupal.composer.json` to `drupal.composer.json` and modify it to your liking.
2. Use the Composer build system by setting `build_composer: true` in your `config.yml` (make sure `build_makefile` is set to `false`).
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`).
3. Configure `drupal_core_path` to point to the webroot directory: `drupal_core_path: {{ drupal_composer_install_dir }}/docroot`

```yaml
build_makefile: false
build_composer_project: false
build_composer: true
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`._
_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`._

## Using Composer when [Drupal VM is a composer dependency itself](../other/drupalvm-composer-dependency.md)

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.
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.

```yaml
build_makefile: false
build_composer_project: false
build_composer: true
drupal_composer_path: false
drupal_composer_install_dir: "/var/www/drupalvm"
Expand All @@ -33,22 +33,14 @@ This is the default Drupal VM build configuration, set up by the following setti
- Composer will build the project if `build_composer_project` is `true`, and `build_makefile` and `build_composer` are both `false`.
- The Composer package is defined by `drupal_composer_project_package`.
- Adjust the create-project CLI options in `drupal_composer_project_options` as well as add additional dependencies in `drupal_composer_dependencies`.
- Ensure that the webroot configured in the Composer package matches the one set in `drupal_core_path`.
- Ensure that the webroot configured in the Composer package matches the one set in `drupal_core_path`. The default is set to `web/`.

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

```yaml
build_makefile: false
build_composer: false
build_composer_project: true
drupal_composer_project_package: "drupal-composer/drupal-project:8.x-dev"
# Added `--no-dev` to avoid installing development dependencies.
drupal_composer_project_options: "--prefer-dist --stability dev --no-interaction --no-dev"
drupal_composer_dependencies:
- "drupal/devel:8.*"

drupal_core_path: "{{ drupal_composer_install_dir }}/web"
drupal_composer_project_package: "acquia/lightning-project:^8.1.0"
drupal_composer_project_options: "--prefer-dist --stability rc --no-interaction"
drupal_core_path: "{{ drupal_composer_install_dir }}/docroot"
```

## Improving composer build performance
Expand Down
2 changes: 1 addition & 1 deletion docs/deployment/local-codebase.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Set all the `build_` variables and `install_site` to `false`:
```yaml
build_makefile: false
build_composer: false
build_composer_project: true
build_composer_project: false
...
install_site: false
```
Expand Down

0 comments on commit e1779d9

Please sign in to comment.