Composer
Code
# Update packages and install unzip.
apt update
apt install unzip
# Download and verify Composer.
cd ~
curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.php
HASH=`curl -sS https://composer.github.io/installer.sig`
echo $HASH
php -r "if (hash_file('SHA384', '/tmp/composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-set
up.php'); } echo PHP_EOL;"
# Install Composer and run it to confirm.
php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer
composer
Drush
Code
# Navigate to the project root, then:
composer require drush/drush
# Add Drush to the PATH, note this works only from project root.
nano ~/.bashrc
# Append this.
export PATH="$PATH:./vendor/bin:/usr/local/bin"
# Create site aliases in
[project_root]/drush/sites
# Test aliases
drush sql:sync @prod @self