diff --git a/.ebextensions/drush-cmd.config b/.ebextensions/drush-cmd.config new file mode 100644 index 0000000..a707cfd --- /dev/null +++ b/.ebextensions/drush-cmd.config @@ -0,0 +1,16 @@ +files: + "/usr/bin/drush": + mode: "000755" + owner: root + group: root + content: | + cd /var/www/html || exit 1 + DRUSH="./vendor/bin/drush" + if [ "$(whoami)" != "webapp" ]; then + SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" + sudo -uwebapp "$SCRIPTPATH/drush" $@ + exit 0 + fi + export $(cat /opt/elasticbeanstalk/deployment/env | xargs) + $DRUSH $@ +