From 6ae60089e1cb163514a9b9333ee95afd232e1e99 Mon Sep 17 00:00:00 2001 From: Diego Pino Navarro Date: Tue, 12 Nov 2019 10:12:32 -0500 Subject: [PATCH] Make composer run without PHP client memory limits This tries to address the problem that happens on very small machines (4 Gbytes on the host) where Docker runs out of memory first before composer has even the change to inform that (returning a "killed" message). If enough memory is around, with this change at least we will give Composer the chance to use all of it. --- scripts/archipelago/update.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/archipelago/update.sh b/scripts/archipelago/update.sh index d25b11fe..c3a503c9 100755 --- a/scripts/archipelago/update.sh +++ b/scripts/archipelago/update.sh @@ -2,10 +2,14 @@ # Part of the Archipelago Commons Project # This should be run as: docker exec -ti esmero-php bash -c 'scripts/archipelago/update.sh' +# If you Host Machine (the one where your keyboard and screen is attached!) has 4Gbytes, memory can run out during +# composer update (you will see a "killed" message. We recommend: +# Do a docker ps first and stop every container except esmero-php and esmero-web. +# Re run this script. echo -ne "Updating Archipelago Packages to whatever is latest in this release!\n" echo -ne "Running as " && whoami; -composer update strawberryfield/strawberryfield strawberryfield/format_strawberryfield strawberryfield/webform_strawberryfield archipelago/archipelago_subtheme --no-scripts; +php -d memory_limit=-1 /usr/bin/composer update strawberryfield/strawberryfield strawberryfield/format_strawberryfield strawberryfield/webform_strawberryfield archipelago/archipelago_subtheme --no-scripts; (($? != 0)) && { printf '%s\n' "Updating strawberryfield packages via composer failed"; exit 1; } drush status bootstrap | grep -q Successful; (($? == 0)) && { drush cr; }