Skip to content

Commit

Permalink
Document how to set base URL with Direnv on a production server with …
Browse files Browse the repository at this point in the history
…multiple Drupal 10 installations

## The Issue

- Fixes drush-ops#6220
  • Loading branch information
gitressa authored Feb 7, 2025
1 parent 18fd76d commit 6f161d5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions docs/using-drush-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Drush configuration is useful to cut down on typing out lengthy and repetitive c
options, and to avoid mistakes.

#### Directories and Discovery
drush.yml files are discovered as below, in order of precedence:
`drush.yml` files are discovered as below, in order of precedence:

1. Drupal site folder (e.g. `sites/{example.com}/drush.yml`).
2. `sites/all/drush`, `WEBROOT/drush`, or `PROJECTROOT/drush`.
Expand All @@ -25,7 +25,14 @@ An alternative way to populate Drush configuration is to define environment vari
correspond to config keys. For example, to populate the `options.uri` config item,
create an environment variable `DRUSH_OPTIONS_URI=http://example.com`.
As you can see, variable names should be uppercased, prefixed with `DRUSH_`, and periods
replaced with underscores.
replaced with underscores. Overall, `DRUSH_OPTIONS_URI` is usually a better approach.

Note: For `uri` you need to use a global location or environment variable, not a site-specific
one, since it's used by Drupal to select which multi-site gets bootstrapped.

#### Direnv for multiple code bases

To handle multiple Drupal installations on the same server, https://direnv.net/ can help, by varying your environment variables, depending on the directory you are in, when you issue a command line request. Use this to define a site URI for each code base.

### Config examples

Expand Down

0 comments on commit 6f161d5

Please sign in to comment.