Create environment variable for the project's own folder
Problem/Motivation
Many jobs now need to be run in the project's own folder which is named $CI_PROJECT_DIR/$_WEB_ROOT/modules/custom/$CI_PROJECT_NAME for modern Drupal, and $CI_PROJECT_DIR/$_WEB_ROOT/sites/all/modules/custom/$CI_PROJECT_NAME for the legacy Drupal 7 jobs.
It would be useful if we had an automatic variable for this path, so that it is easier for custom before_script and after_script rather than have to know how to assemble the path from these variables.
Proposed resolution
Create the variable in .create-environment-variables and write it to the build.env file so that it is available in every subsequent job
The new variable is named $DRUPAL_PROJECT_FOLDER
Remaining tasks
Test every job that uses the new variable:
D10
- composer-base, restoring composer.json.backup - checked here
- composer-lint - checked here
- phpstan - sed on the junit.xml artifact - checked here
- stylelint - checked here
- eslint - checked here
- cspell - checked here
- phpunit concurrent=0 - checked here
- test-only changes - checked here
D7
- composer-base, restoring composer.json.backup - checked here
- phpunit install-drupal with dependencies in .info not composer.json - checked here
- test-only changes - checked here