[Ubuntu] Install sbt from gh releases (#2983)

* Change sbt installation method to gh releases

* add source install.sh
This commit is contained in:
Mikhail Timofeev
2021-03-19 15:20:27 +03:00
committed by GitHub
parent e1ddcff2f0
commit f178f0ec83

View File

@@ -4,11 +4,12 @@
## Desc: Installs sbt
################################################################################
# Install sbt
# https://www.scala-sbt.org/1.x/docs/Installing-sbt-on-Linux.html
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | apt-key add
apt-get -q update
apt-get -y install sbt
source $HELPER_SCRIPTS/install.sh
# Install latest sbt release
sbtVersion=$(curl -s -L "https://api.github.com/repos/sbt/sbt/releases" | jq -r '.[] | select(.prerelease==false).name' | sort --unique --version-sort | grep -ve "-.*" | tail -1)
download_with_retries "https://github.com/sbt/sbt/releases/download/v${sbtVersion}/sbt-${sbtVersion}.tgz" "/tmp" "sbt.tgz"
tar zxf /tmp/sbt.tgz -C /usr/share
ln -s /usr/share/sbt/bin/sbt /usr/bin/sbt
invoke_tests "Tools" "Sbt"