Skip to content

Instantly share code, notes, and snippets.

@pcmantz
Created February 13, 2024 19:53
Show Gist options
  • Select an option

  • Save pcmantz/68e4a3ce88d9135a9748adf286595c30 to your computer and use it in GitHub Desktop.

Select an option

Save pcmantz/68e4a3ce88d9135a9748adf286595c30 to your computer and use it in GitHub Desktop.
Vagrantfile.matrix
# Vagrantfile
RHEL_PACKAGES = %w[
autoconf
bzip2-devel
cpio
curl
expat
gcc
gcc-gfortran
gettext
git
gnupg2
libcurl-devel
make
nano
openssl
pcre-devel
pcre2-devel
perl-ExtUtils-MakeMaker
readline-devel
wget
zlib
].freeze
def clean_tool_version_file(fname)
<<~CMD
cat #{fname} | sort | uniq > #{fname}.new; mv #{fname}.new #{fname}
CMD
end
Vagrant.configure('2') do |config|
config.vm.box = 'almalinux/9'
config.vm.provision('shell', inline: <<~BASH)
dnf update -y
dnf install -y #{RHEL_PACKAGES.join(' ')}
dnf group install "Development Tools"
dnf clean all
BASH
config.vm.provision('shell', inline: <<~BASH, privileged: false)
mkdir -p "$HOME/bin"
curl -sfL https://direnv.net/install.sh | bash
echo 'eval "$(direnv hook bash)"' >> $HOME/.bashrc
echo 'legacy_version_file = yes' >> $HOME/.asdfrc
git clone https://github.com/asdf-vm/asdf.git $HOME/.asdf --branch v0.14.0
export PATH="$PATH:$HOME/.asdf/bin"
echo 'export PATH="$PATH:$HOME/.asdf/bin"' >> $HOME/.bashrc
asdf update
asdf plugin add direnv
asdf direnv setup --shell bash --version system
cd $HOME
echo 'use asdf' >> $HOME/.envrc
direnv allow
asdf plugin add mysql
asdf plugin add r
asdf plugin add ruby
cd /vagrant/
direnv allow
asdf direnv install
bundle install
BASH
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment