diff --git a/test/vagrant-spec/scripts/ubuntu-install-vagrant.sh b/test/vagrant-spec/scripts/ubuntu-install-vagrant.sh new file mode 100755 index 000000000..4804e15bb --- /dev/null +++ b/test/vagrant-spec/scripts/ubuntu-install-vagrant.sh @@ -0,0 +1,33 @@ +#!/bin/bash +set -xe + +# 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 /usr/local/rvm/scripts/rvm + +pushd /vagrant + +# 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 +popd diff --git a/test/vagrant-spec/scripts/ubuntu-run.docker.sh b/test/vagrant-spec/scripts/ubuntu-run.docker.sh index 005fb70a0..19ecba756 100644 --- a/test/vagrant-spec/scripts/ubuntu-run.docker.sh +++ b/test/vagrant-spec/scripts/ubuntu-run.docker.sh @@ -2,7 +2,7 @@ set -x export VAGRANT_SPEC_DOCKER_IMAGE="${VAGRANT_SPEC_DOCKER_IMAGE}" -vagrant vagrant-spec ${VAGRANT_SPEC_ARGS} /vagrant/test/vagrant-spec/configs/vagrant-spec.config.docker.rb +vagrant-spec ${VAGRANT_SPEC_ARGS} /vagrant/test/vagrant-spec/configs/vagrant-spec.config.docker.rb result=$? exit $result diff --git a/test/vagrant-spec/scripts/ubuntu-setup.docker.sh b/test/vagrant-spec/scripts/ubuntu-setup.docker.sh index a5d4dfe80..1e0de689b 100644 --- a/test/vagrant-spec/scripts/ubuntu-setup.docker.sh +++ b/test/vagrant-spec/scripts/ubuntu-setup.docker.sh @@ -6,9 +6,5 @@ apt-get install -qq -y --force-yes curl apt-transport-https apt-get purge -qq -y lxc-docker* || true curl -sSL https://get.docker.com/ | sh -pushd /vagrant +/bin/bash /vagrant/test/vagrant-spec/scripts/ubuntu-install-vagrant.sh -dpkg -i vagrant_*_x86_64.deb -vagrant plugin install ./vagrant-spec.gem - -popd diff --git a/test/vagrant-spec/scripts/ubuntu-setup.virtualbox.sh b/test/vagrant-spec/scripts/ubuntu-setup.virtualbox.sh index 05a764d81..69d190f83 100644 --- a/test/vagrant-spec/scripts/ubuntu-setup.virtualbox.sh +++ b/test/vagrant-spec/scripts/ubuntu-setup.virtualbox.sh @@ -6,33 +6,6 @@ apt-get install -qy linux-headers-$(uname -r) apt-get install -qy virtualbox apt-get install -qy nfs-kernel-server -# 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 +/bin/bash /vagrant/test/vagrant-spec/scripts/ubuntu-install-vagrant.sh -# Install Ruby -curl -sSL https://rvm.io/pkuczynski.asc | sudo gpg --import - -curl -sSL https://get.rvm.io | bash -s stable --ruby -pushd /vagrant - -# 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