Skip to content

Instantly share code, notes, and snippets.

@alexanderfefelov
Last active August 29, 2015 14:02
Show Gist options
  • Save alexanderfefelov/29f0823995870ee45426 to your computer and use it in GitHub Desktop.
Save alexanderfefelov/29f0823995870ee45426 to your computer and use it in GitHub Desktop.
Vagrant shell provisioner: Oracle JDK 8u5, Play Framework 2.2.3, Typesafe Activator 1.2.2, Scala 2.11.1
#=======================================================================================================================
# Vagrant shell provisioner
# Oracle JDK 8u5, Play Framework 2.2.3, Typesafe Activator 1.2.2, Scala 2.11.1
#=======================================================================================================================
#-----------------------------------------------------------------------------------------------------------------------
# Nice stuff
#-----------------------------------------------------------------------------------------------------------------------
apt-get -qq update
apt-get -qq install -y unzip curl htop lynx mc
#-----------------------------------------------------------------------------------------------------------------------
# Oracle JDK
#-----------------------------------------------------------------------------------------------------------------------
JDK_HOME=/opt/jdk
if [ -d "$JDK_HOME" ]; then
rm -rf $JDK_HOME
fi
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u5-b13/jdk-8u5-linux-x64.tar.gz --output-document=jdk-8u5-linux-x64.tar.gz --no-clobber --no-verbose
tar xfz jdk-8u5-linux-x64.tar.gz
chown -R vagrant:vagrant jdk1.8.0_05
mkdir $JDK_HOME
mv -f jdk1.8.0_05 $JDK_HOME
ln -fs $JDK_HOME/jdk1.8.0_05 $JDK_HOME/default
echo JAVA_HOME=$JDK_HOME/default > /etc/profile.d/jdk.sh
echo PATH=\$JAVA_HOME/bin:\$PATH >> /etc/profile.d/jdk.sh
echo export JAVA_HOME PATH >> /etc/profile.d/jdk.sh
#-----------------------------------------------------------------------------------------------------------------------
# Play Framework
#-----------------------------------------------------------------------------------------------------------------------
PLAY_HOME=/opt/play
if [ -d "$PLAY_HOME" ]; then
rm -rf $PLAY_HOME
fi
wget http://downloads.typesafe.com/play/2.2.3/play-2.2.3.zip --output-document=play-2.2.3.zip --no-clobber --no-verbose
unzip -o -qq play-2.2.3.zip
chown -R vagrant:vagrant play-2.2.3
mkdir $PLAY_HOME
mv -f play-2.2.3 $PLAY_HOME
ln -fs $PLAY_HOME/play-2.2.3 $PLAY_HOME/default
if [ ! -d "bin" ]; then
mkdir bin
fi
ln -fs $PLAY_HOME/default/play bin/play
#-----------------------------------------------------------------------------------------------------------------------
# Typesafe Activator
#-----------------------------------------------------------------------------------------------------------------------
ACTIVATOR_HOME=/opt/activator
if [ -d "$ACTIVATOR_HOME" ]; then
rm -rf $ACTIVATOR_HOME
fi
wget http://downloads.typesafe.com/typesafe-activator/1.2.2/typesafe-activator-1.2.2.zip --output-document=typesafe-activator-1.2.2.zip --no-clobber --no-verbose
unzip -o -qq typesafe-activator-1.2.2.zip
chown -R vagrant:vagrant activator-1.2.2
mkdir $ACTIVATOR_HOME
mv -f activator-1.2.2 $ACTIVATOR_HOME
ln -fs $ACTIVATOR_HOME/activator-1.2.2 $ACTIVATOR_HOME/default
if [ ! -d "bin" ]; then
mkdir bin
fi
ln -fs $ACTIVATOR_HOME/default/activator bin/activator
#-----------------------------------------------------------------------------------------------------------------------
# Scala
#-----------------------------------------------------------------------------------------------------------------------
SCALA_HOME=/opt/scala
if [ -d "$SCALA_HOME" ]; then
rm -rf $SCALA_HOME
fi
wget http://downloads.typesafe.com/scala/2.11.1/scala-2.11.1.tgz --output-document=scala-2.11.1.tgz --no-clobber --no-verbose
tar xfz scala-2.11.1.tgz
chown -R vagrant:vagrant scala-2.11.1
mkdir $SCALA_HOME
mv -f scala-2.11.1 $SCALA_HOME
ln -fs $SCALA_HOME/scala-2.11.1 $SCALA_HOME/default
echo SCALA_HOME=$SCALA_HOME/default > /etc/profile.d/scala.sh
echo PATH=\$SCALA_HOME/bin:\$PATH >> /etc/profile.d/scala.sh
echo export SCALA_HOME PATH >> /etc/profile.d/scala.sh
#-----------------------------------------------------------------------------------------------------------------------
# Webmin
#-----------------------------------------------------------------------------------------------------------------------
wget http://www.webmin.com/jcameron-key.asc --no-clobber --no-verbose
apt-key add jcameron-key.asc > /dev/null
grep -q webmin /etc/apt/sources.list || echo deb http://download.webmin.com/download/repository sarge contrib >> /etc/apt/sources.list
apt-get -qq update
apt-get -qq install webmin
#-----------------------------------------------------------------------------------------------------------------------
# Version control
#-----------------------------------------------------------------------------------------------------------------------
apt-get -qq install -y subversion git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment