-
-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: support drupal 11 #146
Changes from 8 commits
083d4c0
486d154
e6a9b87
5f8af1b
8f0b7f1
bd75918
cb89d11
f61627b
ff6f14e
348255a
90e0625
49992f7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,4 @@ src/**/out/ | |
src/**/*.vsix | ||
src/**/.vscode-test/ | ||
drush/ | ||
.ddev/config.gitpod.yaml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Set the default setup during prebuild process | ||
if [ -n "$GITPOD_HEADLESS" ]; then | ||
# Set a default setup if project type wasn't specified | ||
if [ -z "$DP_PROJECT_TYPE" ]; then | ||
export DP_INSTALL_PROFILE='demo_umami' | ||
export DP_PROJECT_TYPE='project_core' | ||
export DP_PROJECT_NAME="drupal" | ||
export DP_CORE_VERSION='10.2.5' | ||
export DP_EXTRA_DEVEL=1 | ||
export DP_EXTRA_ADMIN_TOOLBAR=1 | ||
export DP_PROJECT_TYPE='default_drupalpod' | ||
fi |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,10 +3,28 @@ if [ -n "$DEBUG_SCRIPT" ] || [ -n "$GITPOD_HEADLESS" ]; then | |
set -x | ||
fi | ||
|
||
# Set the default PHP version to 8.1 | ||
if [ -z "$DP_PHP_VERSION" ]; then | ||
DP_PHP_VERSION="8.1" | ||
# If this is an issue fork of Drupal core - set the drupal core version based on that issue fork | ||
if [ "$DP_PROJECT_TYPE" == "project_core" ] && [ -n "$DP_ISSUE_FORK" ]; then | ||
DRUPAL_CORE_VERSION=$(grep 'const VERSION' repos/drupal/core/lib/Drupal.php | awk -F "'" '{print $2}') | ||
else | ||
DRUPAL_CORE_VERSION=$DP_CORE_VERSION | ||
fi | ||
|
||
# set PHP version, based on https://www.drupal.org/docs/getting-started/system-requirements/php-requirements#versions | ||
major_version=$(echo $DRUPAL_CORE_VERSION | cut -d '.' -f 1) | ||
minor_version=$(echo $DRUPAL_CORE_VERSION | cut -d '.' -f 2) | ||
|
||
# Before Drupal 10.2, we should use php 8.2, otherwise use php 8.3 | ||
if (( major_version < 10 )) || { (( major_version == 10 )) && (( minor_version < 2 )); }; then | ||
php_version="8.2" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The php_version seems to always get set to 8.2 when I launch with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess I think that maybe then the condition on line 6 should check emptiness of DP_ISSUE_FORK. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I stand corrected, it still chose 8.2 rather than 8.3. So I think we should not rely on the codebase checkout because it hasn't happened yet? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or maybe if DP_CORE_VERSION does not match what is currently checked out, then ignore the current checkout for this script since it's an init script? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please see the Drupal 11 quickstart. If you There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rfay thank you! I am trying to support multiple drupal versions in drupalpod, and I thought adding There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tested Drupal core 11.x: Tested freelinking 4.0.x using Drupal core 11.x: I haven't done any manual regression testing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Drupal 10.2.x issue with issue fork branch: |
||
else | ||
php_version="8.3" | ||
fi | ||
|
||
cat <<CONFIGEND > .ddev/config.gitpod.yaml | ||
#ddev-gitpod-generated | ||
php_version: "$php_version" | ||
CONFIGEND | ||
|
||
# Misc housekeeping before start | ||
ddev config global --instrumentation-opt-in=false | ||
ddev config global --instrumentation-opt-in=true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid using
sudo
in Dockerfiles to enhance security.Using
sudo
in Dockerfiles can lead to potential security vulnerabilities and configuration errors. Consider running these commands as a non-root user or ensuring that the user context is appropriately managed withoutsudo
.