Created
February 13, 2024 19:53
-
-
Save pcmantz/68e4a3ce88d9135a9748adf286595c30 to your computer and use it in GitHub Desktop.
Vagrantfile.matrix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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