This commit is contained in:
Bozhidar 2024-05-14 15:55:07 +03:00
parent 81fd548876
commit 4eb361646a
2 changed files with 7 additions and 5 deletions

View file

@ -22,11 +22,9 @@ class NodeJsInstaller
{ {
$commands = []; $commands = [];
$commands[] = 'apt-get install -y npm'; $commands[] = 'apt-get install -y npm';
foreach ($this->nodejsVersions as $nodejsVersion) { $commands[] = 'curl -sL https://deb.nodesource.com/setup_20.x -o /tmp/nodesource_setup.sh';
$commands[] = 'curl -sL https://deb.nodesource.com/setup_'.$nodejsVersion.'.x -o /tmp/nodesource'.$nodejsVersion.'_setup.sh'; $commands[] = 'bash /tmp/nodesource_setup.sh';
$commands[] = 'sudo bash /tmp/nodesource'.$nodejsVersion.'_setup.sh'; $commands[] = 'apt-get install nodejs -y';
}
$commands[] = 'sudo apt-get install -y install nodejs';
// Install Apache Passenger // Install Apache Passenger
$commands[] = 'curl https://oss-binaries.phusionpassenger.com/auto-software-signing-gpg-key.txt | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/phusion.gpg >/dev/null'; $commands[] = 'curl https://oss-binaries.phusionpassenger.com/auto-software-signing-gpg-key.txt | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/phusion.gpg >/dev/null';

View file

@ -48,6 +48,10 @@ class HostingSubscriptionWithNodeJSCreateTest extends ActionTestCase
// //
// Make Apache+PHP Application Server with all supported php versions and modules // Make Apache+PHP Application Server with all supported php versions and modules
$installLogFilePath = storage_path('install-apache-nodejs-log-unit-test.txt'); $installLogFilePath = storage_path('install-apache-nodejs-log-unit-test.txt');
if (is_file($installLogFilePath)) {
unlink($installLogFilePath);
}
$phpInstaller = new NodeJsInstaller(); $phpInstaller = new NodeJsInstaller();
$phpInstaller->setNodeJsVersions(array_keys(SupportedApplicationTypes::getNodeJsVersions())); $phpInstaller->setNodeJsVersions(array_keys(SupportedApplicationTypes::getNodeJsVersions()));
$phpInstaller->setLogFilePath($installLogFilePath); $phpInstaller->setLogFilePath($installLogFilePath);