Skip to content
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 drush wrapper #355

Merged
merged 7 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions drupal/rootfs/usr/local/bin/drush
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions drupal/tests/ServiceStartsWithBackendMySQL/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ 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 \
--no-dev \
-- /var/www/drupal

# Install Drush.
composer require drush/drush:^12.1.3
composer require drush/drush:^13.3

# Install actual site.
# shellcheck disable=SC1091
Expand Down
4 changes: 2 additions & 2 deletions drupal/tests/ServiceStartsWithBackendPostgreSQL/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ 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 \
--no-dev \
-- /var/www/drupal

# Install Drush.
composer require drush/drush:^12.1.3
composer require drush/drush:^13.3

# Install actual site.
# shellcheck disable=SC1091
Expand Down
4 changes: 2 additions & 2 deletions nginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions test/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
Loading