From aa8fe570965f845776858d433270ae16339b7a44 Mon Sep 17 00:00:00 2001 From: Jacob Alberty Date: Tue, 20 Oct 2020 21:57:38 -0500 Subject: [PATCH] Install MongoDB commmunity edition on `amd64` --- pre_build/amd64/mongodb.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 pre_build/amd64/mongodb.sh diff --git a/pre_build/amd64/mongodb.sh b/pre_build/amd64/mongodb.sh new file mode 100755 index 00000000..c9b09132 --- /dev/null +++ b/pre_build/amd64/mongodb.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +# Retry 5 times with a wait of 10 seconds between each retry +tryfail() { + for i in $(seq 1 5); + do [ $i -gt 1 ] && sleep 10; $* && s=0 && break || s=$?; done; + (exit $s) +} + +tryfail apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5 + +echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/3.6 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.6.list + +apt-get update +apt-get install -y mongodb-org