Skip to content

Commit

Permalink
Fixed drush in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
tuutti committed Dec 12, 2024
1 parent 89df7cd commit eb5b800
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
5 changes: 4 additions & 1 deletion local/drupal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ RUN apk add --no-cache \
gnupg

COPY entrypoints/ /entrypoints
RUN chmod +x /entrypoints/*
COPY files/usr /usr
RUN chmod +x /entrypoints/* \
# Drush binary is needed in CI.
/usr/local/bin/drush

COPY files/etc/nginx /etc/nginx

Expand Down
18 changes: 18 additions & 0 deletions local/drupal/files/usr/local/bin/drush
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh

# Start at the current directory
dir=$PWD

# While not at the root (/)
while [[ "$dir" != "/" ]]; do
# If vendor/bin/drush exists, run it
if [[ -x "$dir/vendor/bin/drush" ]]; then
"$dir/vendor/bin/drush" "$@"
exit $?
fi
# Go up one directory level
dir=$(dirname "$dir")
done

echo "Could not find drush in any parent directory."
exit 1

0 comments on commit eb5b800

Please sign in to comment.