Commit 85fbb147 authored by Jon Pugh's avatar Jon Pugh

Merge branch '2937147-composer-install' of git.drupal.org:project/provision...

Merge branch '2937147-composer-install' of git.drupal.org:project/provision into 2937147-composer-install
parents c940fabf 90f5915c
......@@ -51,6 +51,10 @@ case "$1" in
# fix permissions on installed directories
chown aegir:aegir "$VARLIB"
# Warn about missing composer, requiring it would break Jessie since it has no such package.
command -v composer >/dev/null 2>&1 || { echo "WARNING: System is missing PHP composer, please install a Debian package or see https://getcomposer.org/" >&2; }
db_get "aegir/drush_version"
DRUSH_VERSION="$RET"
......@@ -88,17 +92,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')
......@@ -107,6 +103,9 @@ case "$1" in
# Symlink Drush for other users to use.
ln -s ~aegir/.composer/vendor/bin/drush /usr/local/bin
# 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
fi
......
......@@ -12,7 +12,7 @@ Vcs-browser: http://drupalcode.org/project/provision.git
Package: aegir3-provision
Architecture: all
Depends: ${misc:Depends}, php5-cli (>= 5.3) | php7.0-cli | php7.1-cli, php5 | php7.0-xml | php7.1-xml, php5-mysql | php7.0-mysql | php7.1-mysql, mysql-client | mariadb-client, sudo, postfix | mail-transport-agent, apache2 | nginx, adduser, ucf, curl
Recommends: mysql-server | mariadb-server, rsync
Recommends: mysql-server | mariadb-server, rsync, composer
Conflicts: aegir-provision, aegir-provision2, aegir2-provision
Replaces: aegir-provision, aegir-provision2, aegir2-provision
Description: mass Drupal hosting system - backend
......
......@@ -103,7 +103,7 @@ function drush_provision_drupal_pre_provision_verify() {
// Composer Install Support
// If drush variable provision_composer_install_platforms is not set to FALSE, run composer install.
if (drush_get_option('provision_composer_install_platforms', TRUE)) {
if (drush_get_option('provision_composer_install_platforms', TRUE) && shell_exec('which composer')) {
// Detect composer-based platform and run composer install if it has not been run yet.
// Step 1: Look for composer directory. Could be Drupal root. Could be the git repo_root.
if (provision_file()->exists(d()->root . DIRECTORY_SEPARATOR . 'composer.json')->status()) {
......
......@@ -34,6 +34,17 @@
* avoid having restores error out during operations such as cloning, migrating, and restoring from
* backup. Default is FALSE.
*
* provision_composer_install_platforms
* Run composer install during a platform's verify task.
* Default is TRUE.
*
* provision_composer_install_command
* The composer command to run on platform verify.
* Default is 'composer install --no-interaction --no-progress --no-dev'.
*
* provision_composer_install_platforms_verify_always
* Run composer install even if the vendor dir already extsts.
* Default is TRUE.
*/
/**
......
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