Extract ubuntu steps for getting Vagrant ready for testing
This commit is contained in:
parent
49ea304ba3
commit
2cc32e9256
33
test/vagrant-spec/scripts/ubuntu-install-vagrant.sh
Executable file
33
test/vagrant-spec/scripts/ubuntu-install-vagrant.sh
Executable file
@ -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
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user