Closed shaal closed 1 year ago
Open the branch in Web Editor • VS Code • Insiders
Open Preview
The changes primarily focus on enhancing the modularity and maintainability of the Drupal setup scripts. They introduce new scripts for environment setup, module installation, and Drupal version specifics. The scripts are now more organized, with each handling a specific task, improving readability and ease of maintenance.
File | Summary |
---|---|
.gitpod/drupal/.../drupal_version_specifics.sh |
Adds support for composer-drupal-lenient package based on the Drupal core version. |
.gitpod/drupal/.../drupalpod-setup.md |
Proposes a new file structure for the drupalpod-setup.sh script, suggesting extraction of logical sections into separate functions or scripts. |
.gitpod/drupal/.../drupalpod-setup.sh |
Refactors the script to source additional files and modifies code related to composer-drupal-lenient . |
.gitpod/drupal/.../install_modules.sh |
Adds a script that sets environment variables for installing additional modules in Drupal. |
.gitpod/drupal/.../setup_env.sh |
Adds a script that sets up default environment variables based on a .env file. |
.gitpod/drupal/install-essential-packages.sh |
Adds a check for vendor directory existence and updates commands to require dev dependencies using ddev composer require . |
🐇💻
Code hopping through the meadow,
In the land of GitPod's shadow.
Scripts modular, clean, and neat,
Making Drupal's setup sweet.
Composer packages, versions core,
Each change opens a new door.
Celebrate this code so fine,
In the land where rabbits code online. 🎉🥕
In .gitpod/drupal/envs-prep/create-environments.sh
, it sets the DDEV project type to Drupal 9.
There was a recent PR to update Drupal 10's settings.ddev.php
file but if I recall it was mostly linting.
However, if we can dynamically set it, we will automatically benefit from any upstream fixes. I tried to add to this PR but I was confused on the correct branch.
- cd "$WORK_DIR"/"$d" && ddev config --docroot=web --create-docroot --project-type=drupal9 --php-version=8.1 --project-name=drupalpod --database=mariadb:10.3
+ majorVersion = cut -d '.' -f 1 <<< "$d"
+ cd "$WORK_DIR"/"$d" && ddev config --docroot=web --create-docroot --project-type=drupal"$majorVersion" --php-version=8.1 --project-name=drupalpod --database=mariadb:10.3
Fixed by PR https://github.com/shaal/DrupalPod/pull/133
The Problem/Issue/Bug
How this PR Solves The Problem
Manual Testing Instructions
Related Issue Link(s)
Release/Deployment notes
Summary by CodeRabbit
Refactor:
drupalpod-setup.sh
script to improve modularity and readability. The script is now divided into logical sections, each handling specific tasks related to Drupal setup and installation.install_modules.sh
andsetup_env.sh
).New Feature:
composer-drupal-lenient
package based on the Drupal core version indrupal_version_specifics.sh
.Chore:
install-essential-packages.sh
to check if the vendor directory exists before requiring dev dependencies. If it doesn't exist, the script will runcomposer install
to prepare the necessary directories.These changes aim to enhance the maintainability of the code and adapt to different Drupal core versions.