600811ab12
Adds image generation and validation for MapR Change-Id: Ib2d3bf2fa43db96437682d7479df1e897b997674
35 lines
829 B
Bash
35 lines
829 B
Bash
#!/bin/bash
|
|
|
|
echo "START: installing Scala"
|
|
sudo yum -y update
|
|
exit 0
|
|
|
|
if [ $test_only -eq 0 ]; then
|
|
|
|
RETURN_CODE="$(curl -s -o /dev/null -w "%{http_code}" http://www.scala-lang.org/)"
|
|
|
|
if [ "$RETURN_CODE" != "200" ]; then
|
|
echo "http://www.scala-lang.org is unreachable" && exit 1
|
|
fi
|
|
|
|
if [ -n "${scala_version:-}" ]; then
|
|
VERSION=$scala_version
|
|
else
|
|
VERSION="$(curl -s --fail http://www.scala-lang.org| tr -d '\n' | sed 's/^.*<div[^<]\+scala-version">[^0-9]\+\([0-9\.\?]\+\)<.\+$/\1/')"
|
|
|
|
if [ $? != 0 -o -z "${VERSION}" ]; then
|
|
echo "Installing default version $scala_version"
|
|
VERSION=$scala_version
|
|
fi
|
|
fi
|
|
|
|
PKG=scala-${VERSION}
|
|
|
|
URL="http://downloads.lightbend.com/scala/${VERSION}"
|
|
|
|
rpm -Uhv ${URL}/${PKG}.rpm
|
|
fi
|
|
|
|
echo "END: installing Scala"
|
|
|