diff --git a/scripts/install.sh b/scripts/install.sh index 2d4145d66..329419212 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -22,9 +22,8 @@ sudo apt-get install -y \ git \ zlib1g-dev \ libgmp-dev \ - nodejs \ - npm \ - net-tools + net-tools \ + libncurses5-dev sudo locale-gen en_US.UTF-8 @@ -58,19 +57,29 @@ echo "Install Erlang & Elixir" export DEBIAN_FRONTEND=noninteractive export LANG=en_US.UTF-8 -wget -O $INSTALL_DIR/erlang-solutions_2.0_all.deb https://packages.erlang-solutions.com/erlang-solutions_2.0_all.deb +if [[ ! -d $HOME/.asdf ]] +then + git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.10.2 +fi -sudo dpkg -i $INSTALL_DIR/erlang-solutions_2.0_all.deb +echo '. $HOME/.asdf/asdf.sh' >> ~/.profile +echo '. $HOME/.asdf/completions/asdf.bash' >> ~/.profile +source ~/.profile -sudo apt-get update -sudo apt-get install -y esl-erlang=1:24.* +asdf update + +asdf plugin add erlang || : +asdf plugin add elixir || : + +cd $SCRIPT_DIR/.. + +asdf install -mkdir -p ~/elixir -wget https://github.com/elixir-lang/elixir/releases/download/v1.14.1/elixir-otp-24.zip -O ~/elixir/Precompiled.zip +ELIXIR_VERSION=$(asdf current elixir 2>&1 | grep -o '\S*' | sed -n 2p) +ERLANG_VERSION=$(asdf current erlang 2>&1 | grep -o '\S*' | sed -n 2p) -unzip ~/elixir/Precompiled.zip -d ~/elixir -echo 'PATH=$PATH:~/elixir/bin' >> ~/.bashrc -source ~/.bashrc +asdf global elixir $ELIXIR_VERSION +asdf global erlang $ERLANG_VERSION echo "Install Libsodium" diff --git a/scripts/release.sh b/scripts/release.sh index 3846ca6e2..758ac21ad 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -39,6 +39,24 @@ do done shift $((OPTIND -1)) +source ~/.profile + +if [[ -d $HOME/.asdf ]] +then + + SCRIPT_DIR=$(dirname $(readlink -f $0)) + + cd $SCRIPT_DIR/.. + + asdf install + + ELIXIR_VERSION=$(asdf current elixir 2>&1 | grep -o '\S*' | sed -n 2p) + ERLANG_VERSION=$(asdf current erlang 2>&1 | grep -o '\S*' | sed -n 2p) + + asdf global elixir $ELIXIR_VERSION + asdf global erlang $ERLANG_VERSION +fi + # Install updated versions of hex/rebar mix local.rebar --force mix local.hex --if-missing --force @@ -49,9 +67,6 @@ export MIX_ENV=prod mix deps.get # Builds WEB assets in production mode -cd assets -npm ci -cd - mix assets.saas mix assets.deploy