long overdue commit: have composer test if its already installed
authoreostre <eostre.danne@protonmail.com>
Tue, 15 Sep 2020 17:21:52 +0000 (13:21 -0400)
committereostre <eostre.danne@protonmail.com>
Tue, 15 Sep 2020 17:21:52 +0000 (13:21 -0400)
dbd-autobuild/files/install-drupal-toolchain.sh

index c8850ae1dde096655502392ad0922636210af610..0aa585a2b8980701a0b5207e03e3a2e27aab1a07 100644 (file)
@@ -1,15 +1,21 @@
 #!/bin/bash -xe
 
-# install composer
-curl -sS https://getcomposer.org/installer | php
-mv composer.phar /usr/local/bin/composer
+# install composer if it's not already installed
+which composer || (\
+       curl -sS https://getcomposer.org/installer | php && \
+       mv composer.phar /usr/local/bin/composer && \
+:) && (\
+       composer self-update &&\
+:)
 
 # use composer to install drush7 and the drush launcher
 cd /var/www
 composer require drush/drush:8.*
-wget -O drush.phar https://github.com/drush-ops/drush-launcher/releases/latest/download/drush.phar
-chmod +x drush.phar
-mv drush.phar /usr/local/bin/drush
+# ^^ PLEASE note that we're installing DRUSH 8, not Drupal 8. drush8 works fine with drupal7
+## actually don't install the drush launcher because it doesn't work with the latest release of drupal7
+#wget -O drush.phar https://github.com/drush-ops/drush-launcher/releases/latest/download/drush.phar
+#chmod +x drush.phar
+#mv drush.phar /usr/local/bin/drush
 
 # use vendor/bin/drush to download drupal
 cd /var/www