From 6dd850dadb1c56708e1dcb1c226dca58dd3e8a31 Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Tue, 21 Dec 2021 15:59:11 -0600 Subject: [PATCH] Make mongodb install aware of CPU Arch being used (#1749) * Make mongodb install aware of CPU Arch being used * Tagging v13.0.2 --- bin/homestead | 2 +- scripts/features/mongodb.sh | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/bin/homestead b/bin/homestead index e48fa12cb..9939e48bc 100755 --- a/bin/homestead +++ b/bin/homestead @@ -8,7 +8,7 @@ if(is_file( __DIR__.'/../vendor/autoload.php')) { require __DIR__.'/../../../autoload.php'; } -$app = new Symfony\Component\Console\Application('Laravel Homestead', '13.0.1'); +$app = new Symfony\Component\Console\Application('Laravel Homestead', '13.0.2'); $app->add(new Laravel\Homestead\MakeCommand); $app->add(new Laravel\Homestead\WslApplyFeatures); diff --git a/scripts/features/mongodb.sh b/scripts/features/mongodb.sh index 31a2f8d2e..ea690100a 100755 --- a/scripts/features/mongodb.sh +++ b/scripts/features/mongodb.sh @@ -16,10 +16,17 @@ then exit 0 fi +ARCH=$(arch) + touch /home/$WSL_USER_NAME/.homestead-features/mongodb chown -Rf $WSL_USER_NAME:$WSL_USER_GROUP /home/$WSL_USER_NAME/.homestead-features -echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list + +if [[ "$ARCH" == "aarch64" ]]; then + echo "deb [ arch=arm64 ] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list +else + echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list +fi curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -