Skip to content
This repository has been archived by the owner on Dec 6, 2019. It is now read-only.

spaced/openshift-cartridge-scala-sbt-launcher

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenShift Cartridge to deploy Applications using sbt launcher

With this cartridge you can easily deploy Scala, Spray, Play and Akka applications, or any java applications, on the Openshift PaaS. using sbt launcher

Usage

Openshift environment:

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

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

Note

First 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@yourapp-$yournamespace.rhcloud.com "tail -f scala/logs/scala.log"

Deployment process

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

In the template project, run start.sh script:

sbt @application.properties

Setup your app

https://github.com/spaced/openshift-cartridge-example-project

Add dependency

"org.scala-sbt" % "launcher-interface" % "1.0.0" % "provided",

and implement a Runner extends xsbti.AppMain (see also http://www.scala-sbt.org/0.13/docs/Launcher-Getting-Started.html) Example: https://github.com/spaced/openshift-cartridge-example-project/blob/master/src/main/scala/com/example/XMain.scala Customize your application.properties If you use sbt as build tool, add following to your sbt build:

publishTo := Some(Resolver.file("file", new File("/path/to/your/openshift_git_repo/localrepo"))
publishMavenStyle := true

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

How deploy:

  • publish your application to localrepo folder (sbt publish)
  • git push

This cartridge will embed a quick start application based on Spray Original Repo. Learn more at spray.io.

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 97.7%
  • HTML 2.3%