From 49ea304ba33c22582d69112ea29d095fbca4bac1 Mon Sep 17 00:00:00 2001 From: sophia Date: Wed, 2 Feb 2022 10:47:20 -0600 Subject: [PATCH] Update centos test setup --- test/vagrant-spec/Vagrantfile.spec | 4 +-- .../scripts/centos-run.virtualbox.sh | 2 +- .../scripts/centos-setup.virtualbox.sh | 29 +++++++++++++++++-- 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/test/vagrant-spec/Vagrantfile.spec b/test/vagrant-spec/Vagrantfile.spec index 23aab1a53..f1d645d6d 100644 --- a/test/vagrant-spec/Vagrantfile.spec +++ b/test/vagrant-spec/Vagrantfile.spec @@ -139,7 +139,7 @@ Vagrant.configure(2) do |global_config| path: "./scripts/#{platform}-run.#{provider_name}.ps1", keep_color: true, env: { - "VAGRANT_SPEC_ARGS" => "--no-builtin #{spec_cmd_args}".strip, + "VAGRANT_SPEC_ARGS" => "#{spec_cmd_args}".strip, "VAGRANT_SPEC_BOX" => "c:/vagrant/#{guest_box.sub('/', '_')}.#{provider_name}.#{box_version}.box", "VAGRANT_SPEC_GUEST_PLATFORM" => guest_platform, } @@ -150,7 +150,7 @@ Vagrant.configure(2) do |global_config| path: "./scripts/#{PLATFORM_SCRIPT_MAPPING[platform]}-run.#{provider_name}.sh", keep_color: true, env: { - "VAGRANT_SPEC_ARGS" => "--no-builtin #{spec_cmd_args}".strip, + "VAGRANT_SPEC_ARGS" => "#{spec_cmd_args}".strip, "VAGRANT_SPEC_BOX" => "/vagrant/test/vagrant-spec/boxes/#{guest_box.sub('/', '_')}.#{provider_name}.#{box_version}.box", "VAGRANT_SPEC_GUEST_PLATFORM" => guest_platform, } diff --git a/test/vagrant-spec/scripts/centos-run.virtualbox.sh b/test/vagrant-spec/scripts/centos-run.virtualbox.sh index 0342a6901..32a80bf94 100644 --- a/test/vagrant-spec/scripts/centos-run.virtualbox.sh +++ b/test/vagrant-spec/scripts/centos-run.virtualbox.sh @@ -3,7 +3,7 @@ set -x export VAGRANT_EXPERIMENTAL="${VAGRANT_EXPERIMENTAL:-1}" export VAGRANT_SPEC_BOX="${VAGRANT_SPEC_BOX}" -vagrant vagrant-spec ${VAGRANT_SPEC_ARGS} /vagrant/test/vagrant-spec/configs/vagrant-spec.config.virtualbox.rb +vagrant-spec ${VAGRANT_SPEC_ARGS} --config /vagrant/test/vagrant-spec/configs/vagrant-spec.config.virtualbox.rb result=$? exit $result diff --git a/test/vagrant-spec/scripts/centos-setup.virtualbox.sh b/test/vagrant-spec/scripts/centos-setup.virtualbox.sh index aa7695273..77cffb475 100644 --- a/test/vagrant-spec/scripts/centos-setup.virtualbox.sh +++ b/test/vagrant-spec/scripts/centos-setup.virtualbox.sh @@ -6,9 +6,34 @@ yum groupinstall -y "Development Tools" yum install -y kernel-devel-$(uname -r) yum install -y VirtualBox-${VAGRANT_CENTOS_VIRTUALBOX_VERSION:-5.1} +# Install Go +wget -O go.tar.gz https://go.dev/dl/go1.17.6.linux-amd64.tar.gz +tar -xzf go.tar.gz --directory /usr/local +export PATH=$PATH:/usr/local/go/bin +go version + +# Install Ruby +curl -sSL https://rvm.io/pkuczynski.asc | sudo gpg --import - +curl -sSL https://get.rvm.io | bash -s stable --ruby +source .bashrc + pushd /vagrant -rpm -ivh ./pkg/dist/vagrant_*_x86_64.rpm -vagrant plugin install ./vagrant-spec.gem +# Get vagrant-plugin-sdk repo +git config --global url."https://${HASHIBOT_USERNAME}:${HASHIBOT_TOKEN}@github.com".insteadOf "https://github.com" + +# Build Vagrant artifacts +gem install bundler -v "$(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -n 1)" +make +bundle install +ln -s /vagrant/vagrant /bin/vagrant popd + +# Install vagrant-spec +git clone https://github.com/hashicorp/vagrant-spec.git +pushd vagrant-spec +gem build vagrant-spec.gemspec +gem install vagrant-spec*.gem +vagrant-spec -h +popd