]> cat aescling's git repositories - mastodon.git/commitdiff
Add clearer error when/if gpg fails to install (#10228)
authorArmand Fardeau <armandfardeau@users.noreply.github.com>
Sun, 10 Mar 2019 15:00:22 +0000 (16:00 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Sun, 10 Mar 2019 15:00:22 +0000 (16:00 +0100)
Vagrantfile

index f9839fffb9cb3cc392d059743327df8ee08edadf..c4941f673138788a09b57b4afc5b425bf56a5cfd 100644 (file)
@@ -44,7 +44,18 @@ sudo apt-get install \
 
 # Install rvm
 read RUBY_VERSION < .ruby-version
-gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
+
+gpg_command="gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB"
+$($gpg_command)
+if [ $? -ne 0 ];then
+  echo "GPG command failed, This prevented RVM from installing."
+  echo "Retrying once..." && $($gpg_command)
+  if [ $? -ne 0 ];then
+    echo "GPG failed for the second time, please ensure network connectivity."
+    echo "Exiting..." && exit 1
+  fi
+fi
+
 curl -sSL https://raw.githubusercontent.com/rvm/rvm/stable/binscripts/rvm-installer | bash -s stable --ruby=$RUBY_VERSION
 source /home/vagrant/.rvm/scripts/rvm