Skip to content

Commit d31086e

Browse files
* Adapt to https://git.drupalcode.org/project/gitlab_templates/-/commit/e32e8cf * Make it configurable * Update README.md Co-authored-by: Moshe Weitzman <[email protected]> * Give it a try * Maybe * This? * One more try * Update commands/web/symlink-project Co-authored-by: Moshe Weitzman <[email protected]> * Try removing unneeded changes * Update readme --------- Co-authored-by: Moshe Weitzman <[email protected]>
1 parent 28965c4 commit d31086e

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

README.md

+17-2
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,33 @@ Run tests on the `web/modules/custom` directory:
7171
- `cweagans/composer-patches:^1` is added by `ddev poser` so feel free to configure any patches that your project needs.
7272
- Any development dependencies (e.g. Drush) should be manually added to require-dev in your project's composer.json file. Don't use the `composer require` command to do that.
7373

74+
## Changing defaults
75+
76+
Override any environment variable value from [.ddev/config.contrib.yaml](config.contrib.yaml) by creating a `.ddev/config.local.yaml` (or [any filename lexicographically following config.contrib.yaml](https://ddev.readthedocs.io/en/stable/users/extend/customization-extendibility/#extending-configyaml-with-custom-configyaml-files)) file which has the same structure as [.ddev/config.contrib.yaml](config.contrib.yaml). Add your overrides under `web_environment`.
77+
7478
### Changing the Drupal core version
7579

76-
- To customize the version of Drupal core, create a `.ddev/config.local.yaml` (or [any filename lexicographically following config.contrib.yaml](https://ddev.readthedocs.io/en/stable/users/extend/customization-extendibility/#extending-configyaml-with-custom-configyaml-files)) with contents similar to
80+
In `.ddev/config.local.yaml` set the Drupal core version:
7781
```
7882
web_environment:
7983
- DRUPAL_CORE=^11
8084
```
8185

82-
After creating this file, run `ddev restart` and then `ddev poser` to update the Drupal core version.
86+
Then run `ddev restart` and then `ddev poser` to update the Drupal core version.
8387

8488
If Drupal core cannot be changed because the project is using an unsupported version of PHP, `ddev poser` will show a `composer` error. In that case, open `.ddev/config.yaml` and change the `PHP_VERSION` to a supported version; then run `ddev restart` and `ddev poser` again. Note that the project PHP version is set in `.ddev/config.yaml`, while the core version to use is set in `.ddev/config.local.yaml`.
8589

90+
### Changing the symlink location
91+
92+
In `.ddev/config.local.yaml` set the location relative to webroot (which usually is `web/`). Defaults to `modules/custom`
93+
```
94+
web_environment:
95+
- ...
96+
- DRUPAL_PROJECTS_PATH=modules
97+
```
98+
99+
Then restart DDEV by running `ddev restart`.
100+
86101
## Example of successful test
87102

88103
This is what a successful test looks like, based on [Config Enforce Devel](https://www.drupal.org/project/config_enforce_devel).

commands/web/symlink-project

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
## ExecRaw: true
99

1010
export _WEB_ROOT=$DDEV_DOCROOT
11+
export DRUPAL_PROJECTS_PATH=${DRUPAL_PROJECTS_PATH:-modules/custom}
1112
#todo use more dynamic ref.
1213
cd "$DDEV_COMPOSER_ROOT" || exit
1314
curl -OL https://git.drupalcode.org/project/gitlab_templates/-/raw/default-ref/scripts/symlink_project.php

tests/_common.bash

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ _common_setup() {
1010
ddev delete -Oy ${PROJNAME} >/dev/null 2>&1 || true
1111
cp -R ${DIR}/tests/testdata/test_drupal_contrib/* ${TESTDIR}
1212
cd ${TESTDIR}
13-
ddev config --project-name=${PROJNAME} --project-type=drupal --docroot=web --php-version=8.3 --corepack-enable
13+
ddev config --project-name=${PROJNAME} --project-type=drupal --docroot=web --php-version=8.3 --corepack-enable
1414
if [ -n "$TEST_DRUPAL_CORE" ] && [ "$TEST_DRUPAL_CORE" != "default" ]; then
1515
echo -e "web_environment:\n - DRUPAL_CORE=^${TEST_DRUPAL_CORE}" > .ddev/config.~overrides.yaml
1616
fi

0 commit comments

Comments
 (0)