Integrate Github Repo with Travis CI For Scala Play2.0 and MongoDB Project

Reading Time: 2 minutes

Travis CI is a hosted, distributed  continuous integration service used to build and test projects hosted at  GitHub for the open source community.

It supports building software in numerous languages, including Ruby, JavaScript, Java, Scala, PHP, Haskell and Erlang.

A Travis worker comes with a good amount of services you might depend on, including MySQL, PostgreSQL, MongoDB, Redis, CouchDB, RabbitMQ, memcached and others.

Hosting your project on means you can effortlessly test your library or applications against multiple runtimes and data stores without even having all of them installed locally.

Steps to integrate with Travis-CI :

Step #1 : Sign in Travis-CI with GitHub Account

To get started with Travis CI, sign in through your GitHub Account in

Then GitHub will ask you for granting read- and write access.

Step #2 : Activate GitHub Service Hook

After Signing in, you need to activate GitHub Service Hook. For this you have to go  to your profile page in Travis CI where you find the list of your all GitHub’s repositories.Flip the on/off switch for each repository that you want to hook up on Travis CI.

To confirm that Travis CI activated for your repo(s)  , go to settings of your repo on GitHub

Settings -> Service Hooks ->Available Service Hooks  here you find that Travis option  in the list is activated.

When you click on Travis you find that GitHub user-name and Travis token into the settings for the Travis service is  already pre-filled.


Step #3: Add .travis.yml file 

In order for Travis to build your project , add .travis.yml to the root of your repository.

.travis.yml example for Scala , Play 2.0 and MongoDB Project

[sourcecode language=”scala” wraplines=”false” collapse=”false”]
language: scala
– 2.9.2
– 2.9.1
– openjdk7
– oraclejdk7

– mongodb
– memcache


– wget${PLAY_VERSION}.zip
– unzip -q play-${PLAY_VERSION}.zip
–  sbt test

email: false[/sourcecode]

Step #4: Make a Git Push Request for trigger your first build on Travis CI

Once GitHub hook is set up, push your commit that adds .travis.yml to your repository. That should add a build into one of the queues on Travis CI and your build will start as soon as one worker for your language is available.

[sourcecode language=”scala” wraplines=”false” collapse=”false”]
git commit -a -m “Add Travis CI”
git push origin master

Step #5 : Add Status image To

To add a status image  copy the Markdown from and paste into your File. For Example :


When you click on it you would redirect to your Travis CI Build Detail Page .

By following the above mentioned steps you can integrate your GitHub Repo with Travis-CI.

For More details refer to following link :  Travis CI Started Guide

For Reference To  Scalajobz   .travis.yml File :

knoldus/scalajobz  Travis CI Build Configuration  :

Written by 

Principal Architect at Knoldus Inc

1 thought on “Integrate Github Repo with Travis CI For Scala Play2.0 and MongoDB Project3 min read

Comments are closed.