This may help people who get trapped by this like I did, simple unless you remember the deploy script uses php cli...
Have the following error message on running the deploy script:
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 1670019 bytes) in /var/www/CalemEAM/build/CalemZipJustJs.php on line 72
As you can see, there is plenty of memory, and the /etc/php5/apache2/php.ini has 128M allocated - answer is to update the /etc/php5/cli/php.ini file