Commit 153d4510 authored by helmo's avatar helmo

Install composer from the Debian package script

parent bc6326d6
......@@ -51,6 +51,19 @@ case "$1" in
# fix permissions on installed directories
chown aegir:aegir "$VARLIB"
db_get "aegir/composer_version"
if [ "$COMPOSER_VERSION" = "stable" ]; then
# Install composer.
COMPOSER_HOME="$HOME/.composer"
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
# Add composer's bin dir to the $PATH.
# TODO: This should be made idempotent.
echo "export PATH=\"\$HOME/.composer/vendor/bin:\$PATH\"" >> ~aegir/.bashrc
fi
db_get "aegir/drush_version"
DRUSH_VERSION="$RET"
......@@ -88,17 +101,9 @@ case "$1" in
else # Drush versions prior to 8 aren't available as .phar's.
# Install composer.
COMPOSER_HOME="$HOME/.composer"
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
# Install Drush.
su -c "composer global require drush/drush:$DRUSH_VERSION" aegir
# Add composer's bin dir to the $PATH.
echo "export PATH=\"\$HOME/.composer/vendor/bin:\$PATH\"" >> ~aegir/.bashrc
# Rename an old drush executable.
if [ -f /usr/local/bin/drush ]; then
mv /usr/local/bin/drush /usr/local/bin/drush-old-$(date +'%Y-%m-%d')
......
......@@ -5,3 +5,8 @@ Description: Drush version to use. "stable" will fetch the latest release.
"unstable" will fetch the daily dev build. Otherwise, specify a version
number, e.g. "8.0.3".
Template:aegir/composer_version
Type: string
Default: stable
Description: Composer version to use. "stable" will fetch the latest release.
"ignore" will no nothing.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment