Backend Scala Playframework Quickstarter (be-scala-play)
Purpose of this quickstarter
This is a Play Framework 2.8.0 quickstarter with basic setup for Docker, Jenkins, SonarQube and OpenShift.
Use it if you want to build an reactive Web Application / REST API based on the Scala Language.
What files / architecture is generated?
An example Play Web Application is generated with a Controller and some tests.
. ├── Jenkinsfile ├── app │ ├── controllers │ │ └── HomeController.scala │ └── views │ ├── index.scala.html │ └── main.scala.html ├── build.sbt ├── conf │ ├── application.conf │ ├── logback.xml │ ├── messages │ └── routes ├── docker │ └── Dockerfile ├── project │ ├── build.properties │ ├── plugins.sbt ├── public │ ├── images │ │ └── favicon.png │ ├── javascripts │ │ └── main.js │ └── stylesheets │ └── main.css ├── sonar-project.properties ├── test │ └── controllers │ └── HomeControllerSpec.scala └── .scalafmt.conf
Frameworks used
This project is generated by SBT using SBTs template generation via the new
command.
The template used is an adapted version of the official Play Scala Seed Template.
It will generate a Play Scala project using version 2.8.0 of Play with Scala version 2.13.1. It uses the logstash-logback-encoder to output logmessages in logstash format. It uses Scalafmt to check/format the source files consistently.
Usage - how do you start after you provisioned this quickstarter
-
Start the SBT shell with
sbt
in the project root directory. -
In the SBT shell run
test
for testing -
Or
run
for running locally in development mode with continous compiling. The application will be accessible under http://localhost:8080
How this quickstarter is built through jenkins
The Jenkinsfile is provisioned with this quickstarter to ease CI/CD process. In Jenkinsfile, there are various stages
-
stageBuild - checks source files formatting, runs the tests and builds and copies the artifacts for creating the docker image to the
docker
directory.
Builder agent used
This quickstarter uses the Scala Jenkins agent.