From c749d09363f0e90775858a3178119664fde619ee Mon Sep 17 00:00:00 2001 From: Joe Corall Date: Thu, 14 Nov 2024 05:39:41 -0500 Subject: [PATCH] Fix drush wrapper (#355) * Fix drush wrapper * bump drupal core+drush test versions * Fix test * Close #342 * Do not break folks who haven't upgrade drush yet * Update drush * update composer --- README.md | 2 ++ drupal/rootfs/usr/local/bin/drush | 9 +++++++-- drupal/tests/ServiceStartsWithBackendMySQL/test.sh | 4 ++-- drupal/tests/ServiceStartsWithBackendPostgreSQL/test.sh | 4 ++-- nginx/Dockerfile | 4 ++-- test/Dockerfile | 4 ++-- 6 files changed, 17 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 0d9e0f4d..36c460d2 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,8 @@ To build the Docker images using the provided Gradle build scripts requires: > N.B The version of `make` that comes with OSX is to old, please update > using `brew` etc. +> N.B On Mac OSX you may need to run `docker context use default` before `make bake` + To verify you have all the requirements run the following command. ```bash diff --git a/drupal/rootfs/usr/local/bin/drush b/drupal/rootfs/usr/local/bin/drush index cba50aee..bb8168eb 100755 --- a/drupal/rootfs/usr/local/bin/drush +++ b/drupal/rootfs/usr/local/bin/drush @@ -1,14 +1,19 @@ #!/usr/bin/env bash set -e +DRUSH_EXECUTABLE=/var/www/drupal/vendor/bin/drush +if [ -f /var/www/drupal/vendor/bin/drush.php ]; then + DRUSH_EXECUTABLE=/var/www/drupal/vendor/bin/drush.php +fi + # Ensures drush runs as the correct user, and does not run out of memory. # Takes precedence due to order of $PATH. Preferred to an alias as it will apply # regardless of which shell is used or how it is started (login, interactive, etc) if test "$(id -u)" -eq 0; then # If root run as nginx. - s6-setuidgid nginx php -d memory_limit=-1 /var/www/drupal/vendor/bin/drush "${@}" + s6-setuidgid nginx php -d memory_limit=-1 "${DRUSH_EXECUTABLE}" "${@}" else # If non-root user, then run as current user # as we do not have permissions to switch user. - php -d memory_limit=-1 /var/www/drupal/vendor/bin/drush "${@}" + php -d memory_limit=-1 "${DRUSH_EXECUTABLE}" "${@}" fi diff --git a/drupal/tests/ServiceStartsWithBackendMySQL/test.sh b/drupal/tests/ServiceStartsWithBackendMySQL/test.sh index b81e0255..762b02e8 100755 --- a/drupal/tests/ServiceStartsWithBackendMySQL/test.sh +++ b/drupal/tests/ServiceStartsWithBackendMySQL/test.sh @@ -7,7 +7,7 @@ source /usr/local/share/isle/utilities.sh # Install basic Drupal cd /var/www/drupal || exit 1 rm -fr /var/www/drupal/* -composer create-project drupal/recommended-project:^10.1.2 \ +composer create-project drupal/recommended-project:^10.3 \ --prefer-dist \ --no-interaction \ --stability stable \ @@ -15,7 +15,7 @@ composer create-project drupal/recommended-project:^10.1.2 \ -- /var/www/drupal # Install Drush. -composer require drush/drush:^12.1.3 +composer require drush/drush:^13.3 # Install actual site. # shellcheck disable=SC1091 diff --git a/drupal/tests/ServiceStartsWithBackendPostgreSQL/test.sh b/drupal/tests/ServiceStartsWithBackendPostgreSQL/test.sh index 5f64bb2a..58bbe239 100755 --- a/drupal/tests/ServiceStartsWithBackendPostgreSQL/test.sh +++ b/drupal/tests/ServiceStartsWithBackendPostgreSQL/test.sh @@ -7,7 +7,7 @@ source /usr/local/share/isle/utilities.sh # Install basic Drupal cd /var/www/drupal || exit 1 rm -fr /var/www/drupal/* -composer create-project drupal/recommended-project:^10.1.2 \ +composer create-project drupal/recommended-project:^10.3 \ --prefer-dist \ --no-interaction \ --stability stable \ @@ -15,7 +15,7 @@ composer create-project drupal/recommended-project:^10.1.2 \ -- /var/www/drupal # Install Drush. -composer require drush/drush:^12.1.3 +composer require drush/drush:^13.3 # Install actual site. # shellcheck disable=SC1091 diff --git a/nginx/Dockerfile b/nginx/Dockerfile index bcbc72a8..a901f7de 100644 --- a/nginx/Dockerfile +++ b/nginx/Dockerfile @@ -2,10 +2,10 @@ FROM base ARG TARGETARCH -ARG COMPOSER_VERSION=2.7.7 +ARG COMPOSER_VERSION=2.8.2 ARG COMPOSER_FILE=composer.phar ARG COMPOSER_URL=https://getcomposer.org/download/${COMPOSER_VERSION}/${COMPOSER_FILE} -ARG COMPOSER_SHA256=aab940cd53d285a54c50465820a2080fcb7182a4ba1e5f795abfb10414a4b4be +ARG COMPOSER_SHA256=9ed076041e269820c6c4223d66c5325fcaddc7f4b4317b3ba936812a965857ed WORKDIR /var/www diff --git a/test/Dockerfile b/test/Dockerfile index 216464d4..b25286d8 100644 --- a/test/Dockerfile +++ b/test/Dockerfile @@ -2,10 +2,10 @@ FROM drupal ARG TARGETARCH -ARG COMMIT=a129ed9e57b0de749f7c32f61684d639031e74ae +ARG COMMIT=0693b06dd961e5ea0deaaa1ce35925081831bfcf ARG FILE=${COMMIT}.tar.gz ARG URL=https://github.com/Islandora/islandora-starter-site/archive/${FILE} -ARG SHA256=a91638746f9acb61a83e2f03d5e62c844feede574f3b71795982d0aebe6967b7 +ARG SHA256=5a780f8c960dafa633bbf9c09211c4456288adc53a98b757816e4d0a6468df7b # Platform agnostic does not require arch specific identifier. RUN --mount=type=cache,id=test-downloads-${TARGETARCH},sharing=locked,target=/opt/downloads \