Skip to content

waynebli/openshift-cartridge-scala

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenShift Cartridge to deploy Reactive Applications

With this cartridge you can easily deploy Scala, Spray, Play and Akka applications, or any SBT based applications, on the Openshift PaaS.

Usage

Openshift environment:

rhc app create demoreactiveapp \
http://cartreflect-claytondev.rhcloud.com/reflect?github=47deg/openshift-cartridge-scala

That's all! Now all that is left is to wait for the deployment to complete ;)

Note

Deployment can sometimes be a rather slow process. Be patient with it and check on the deployment process with following command:

 ssh id_to_replace@demoreactiveapp-$yournamespace.rhcloud.com "tail -f scala/logs/scala.log"

Deployment process

After each git push, sbt compile will be automatically called, followed by the start.sh script at the root of your repo.

In the template project, run start.sh script:

activator run

Another example:

sbt run com.example.Boot.main

Make sure start.sh has the correct permissions to execute: chmod +x start.sh

In your application listen on the environment variable $OPENSHIFT_SCALA_IP:$OPENSHIFT_SCALA_PORT

interface = System.getenv("OPENSHIFT_SCALA_IP")
port = System.getenv("OPENSHIFT_SCALA_PORT").toInt

This cartridge will embed a quick start application based on Spray Original Repo. Learn more at spray.io. However, you could use any framework as long as SBT (or an SBT wrapper like activator) is used for compilation.

About

Getting started with Scala, Akka and Spray with this OpenShift cartridge

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published