Install elixir/erlang as unprivileged

This commit is contained in:
Jamil Bou Kheir
2020-05-03 13:31:52 -07:00
parent c41eaca514
commit 80a6264437
3 changed files with 22 additions and 19 deletions

3
Vagrantfile vendored
View File

@@ -7,5 +7,6 @@ Vagrant.configure("2") do |config|
vb.memory = "1024"
end
config.vm.provision "shell", path: "provision.sh"
config.vm.provision "shell", path: "provision_deps.sh", privileged: true
config.vm.provision "shell", path: "provision_runtimes.sh", privileged: false
end

View File

@@ -61,21 +61,3 @@ apt-get install -y --no-install-recommends \
libwxgtk3.0-dev \
wireguard wireguard-tools wireguard-dkms \
nftables
# Install asdfgit clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.7.o
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.7.8
echo '. $HOME/.asdf/asdf.sh' >> ~/.bash_profile
echo '. $HOME/.asdf/completions/asdf.bash' >> ~/.bash_profile
source ~/.bash_profile
asdf plugin-add erlang
asdf install erlang 22.3.3
asdf global erlang 22.3.3
asdf plugin-add elixir
asdf install elixir 1.10.3-otp-22
asdf global elixir 1.10.3-otp-22
# Is it working?
elixir -e 'IO.puts("Hello World!")'

20
provision_runtimes.sh Normal file
View File

@@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -e
# Install runtimes as vagrant user
# Install asdf
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.7.8
echo '. $HOME/.asdf/asdf.sh' >> ~/.bash_profile
echo '. $HOME/.asdf/completions/asdf.bash' >> ~/.bash_profile
source ~/.bash_profile
asdf plugin-add erlang
asdf install erlang 22.3.3
asdf global erlang 22.3.3
asdf plugin-add elixir
asdf install elixir 1.10.3-otp-22
asdf global elixir 1.10.3-otp-22
# Is it working?
elixir -e 'IO.puts("Hello World!")'