From 5dfbd20aa34dec60d849faa5b27dfe72c89d4999 Mon Sep 17 00:00:00 2001 From: Ricardo Aielo Date: Thu, 8 Aug 2019 15:25:34 -0700 Subject: [PATCH 1/7] Box updated to ubuntu/bionic64 (18.04) --- Vagrantfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 909bebf66..14a3887eb 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -4,7 +4,7 @@ # Ruby, run unit tests, etc. Vagrant.configure("2") do |config| - config.vm.box = "hashicorp/precise64" + config.vm.box = "ubuntu/bionic64" config.vm.hostname = "vagrant" config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'" From 7167c9a2fed1e8f846f805f53794929ad4d3135c Mon Sep 17 00:00:00 2001 From: Ricardo Aielo Date: Thu, 8 Aug 2019 15:31:14 -0700 Subject: [PATCH 2/7] RVM installed with apt-get (ubuntu_rvm) --- Vagrantfile | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 14a3887eb..665bcdcfb 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -36,21 +36,22 @@ if [ -f "${MARKER_FILE}" ]; then exit 0 fi +# Add ubuntu_rvm repo +apt-add-repository -y ppa:rael-gc/rvm + # Update apt apt-get update --quiet -# Install basic dependencies -apt-get install -qy build-essential bsdtar curl +# Add vagrant user to sudo group: +# ubuntu_rvm only adds users in group sudo to group rvm +usermod -a -G sudo vagrant + +# Install basic dependencies and RVM +apt-get install -qy build-essential bsdtar rvm # Import the mpapis public key to verify downloaded releases su -l -c 'gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3' vagrant -# Install RVM -su -l -c 'curl -sL https://get.rvm.io | bash -s stable' vagrant - -# Add the vagrant user to the RVM group -#usermod -a -G rvm vagrant - # Install latest Ruby that complies with Vagrant's version constraint RUBY_VER_LATEST=$(su -l -c 'rvm list known' vagrant | tr '[]-' ' ' | awk "/^ ruby ${RUBY_VER_REQ:0:1}\./ { print \$2 }" | sort | tail -n1) su -l -c "rvm install ${RUBY_VER_LATEST}" vagrant From 068e348826664f37f719490c7673aaafe3c955ac Mon Sep 17 00:00:00 2001 From: Ricardo Aielo Date: Thu, 8 Aug 2019 15:42:45 -0700 Subject: [PATCH 3/7] Next-to-last ruby to avoid unsupported version from gemspec --- Vagrantfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 665bcdcfb..26d3e80a9 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -52,10 +52,10 @@ apt-get install -qy build-essential bsdtar rvm # Import the mpapis public key to verify downloaded releases su -l -c 'gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3' vagrant -# Install latest Ruby that complies with Vagrant's version constraint -RUBY_VER_LATEST=$(su -l -c 'rvm list known' vagrant | tr '[]-' ' ' | awk "/^ ruby ${RUBY_VER_REQ:0:1}\./ { print \$2 }" | sort | tail -n1) -su -l -c "rvm install ${RUBY_VER_LATEST}" vagrant -su -l -c "rvm --default use ${RUBY_VER_LATEST}" vagrant +# Install next-to-last Ruby that complies with Vagrant's version constraint +RUBY_VER=$(su -l -c 'rvm list known' vagrant | tr '[]-' ' ' | awk "/^ ruby ${RUBY_VER_REQ:0:1}\./ { print \$2 }" | sort -r | sed -n '2p') +su -l -c "rvm install ${RUBY_VER}" vagrant +su -l -c "rvm --default use ${RUBY_VER}" vagrant # Output the Ruby version (for sanity) su -l -c 'ruby --version' vagrant @@ -64,7 +64,7 @@ su -l -c 'ruby --version' vagrant apt-get install -qy git # Upgrade Rubygems -su -l -c "rvm ${RUBY_VER_LATEST} do gem update --system" vagrant +su -l -c "rvm ${RUBY_VER} do gem update --system" vagrant # Install bundler and prepare to run unit tests su -l -c "gem install bundler -v ${BUNDLER_VER_REQ}" vagrant From 546cd90cea4a1191a2d9ebe7e5a6dfa46e1f2ac1 Mon Sep 17 00:00:00 2001 From: Ricardo Aielo Date: Thu, 8 Aug 2019 15:53:03 -0700 Subject: [PATCH 4/7] Removed explicit bundler install since there is no dependency in gemspec --- Vagrantfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 26d3e80a9..87898ff2e 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -29,7 +29,6 @@ $shell = <<-'CONTENTS' export DEBIAN_FRONTEND=noninteractive MARKER_FILE="/usr/local/etc/vagrant_provision_marker" RUBY_VER_REQ=$(awk '$1 == "s.required_ruby_version" { print $4 }' /vagrant/vagrant.gemspec | tr -d '"') -BUNDLER_VER_REQ=$(awk '/s.add_dependency "bundler"/ { print $4 }' /vagrant/vagrant.gemspec | tr -d '"') # Only provision once if [ -f "${MARKER_FILE}" ]; then @@ -66,8 +65,7 @@ apt-get install -qy git # Upgrade Rubygems su -l -c "rvm ${RUBY_VER} do gem update --system" vagrant -# Install bundler and prepare to run unit tests -su -l -c "gem install bundler -v ${BUNDLER_VER_REQ}" vagrant +# Prepare to run unit tests su -l -c 'cd /vagrant; bundle install' vagrant # Automatically move into the shared folder, but only add the command From 990bc107fa0f99b866e0153fa26725659f32ddca Mon Sep 17 00:00:00 2001 From: Ricardo Aielo Date: Thu, 8 Aug 2019 15:55:46 -0700 Subject: [PATCH 5/7] grep error suppressed in case .bash_profile does not exist --- Vagrantfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 87898ff2e..3b8ea591f 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -70,7 +70,7 @@ su -l -c 'cd /vagrant; bundle install' vagrant # Automatically move into the shared folder, but only add the command # if it's not already there. -grep -q 'cd /vagrant' /home/vagrant/.bash_profile || echo 'cd /vagrant' >> /home/vagrant/.bash_profile +grep -q 'cd /vagrant' /home/vagrant/.bash_profile 2>/dev/null || echo 'cd /vagrant' >> /home/vagrant/.bash_profile # Touch the marker file so we don't do this again touch ${MARKER_FILE} From ae3ae5078f42dfed6aba95c44a975280dcce03e7 Mon Sep 17 00:00:00 2001 From: Ricardo Aielo Date: Thu, 8 Aug 2019 19:11:52 -0700 Subject: [PATCH 6/7] Memory set to 2GB to run tests with no Errno::ENOMEM --- Vagrantfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 3b8ea591f..41a80253b 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -10,7 +10,7 @@ Vagrant.configure("2") do |config| ["vmware_fusion", "vmware_workstation", "virtualbox"].each do |provider| config.vm.provider provider do |v, override| - v.memory = "1024" + v.memory = "2048" end end From 365111f3bb8abd5ffb9faebaaffcaaab0a785a8d Mon Sep 17 00:00:00 2001 From: Ricardo Aielo Date: Sun, 22 Sep 2019 13:07:46 -0300 Subject: [PATCH 7/7] Box switched to hashicorp/bionic64 and supported providers adjusted --- Vagrantfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 41a80253b..9004ec678 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -4,11 +4,11 @@ # Ruby, run unit tests, etc. Vagrant.configure("2") do |config| - config.vm.box = "ubuntu/bionic64" + config.vm.box = "hashicorp/bionic64" config.vm.hostname = "vagrant" config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'" - ["vmware_fusion", "vmware_workstation", "virtualbox"].each do |provider| + ["vmware_desktop", "virtualbox", "hyperv"].each do |provider| config.vm.provider provider do |v, override| v.memory = "2048" end