Continuous Integration With Travis-CI, Scala, Play2 and Heroku

During the London Scala community hackday at the Guardian, we first put together the LSug community webapp. For this we used Play2 framework, MongoDB, Github for pull requests and deployed onto Heroku.

Towards the end of the hackathon, someone suggested we also wired the project up to Travis-CI, although none of us knew much about using it. As the hackday was all about discovering how to use new stuff, I decided to add Travis-CI and worry about setting it up when we got to it.

What is Travis-CI ?

Travis-CI** is a continuous integration service that allows you to run build jobs and tests automatically, straight from Github. Its ideal for open source projects.

As its on the web then there is no installation required and its really easier to configure. You simply point Travis-CI to your Github account and you can choose which projects you want Travis-CI to run on. Travis-CI will scan you public repositories, as well as any Github organisations you are part of. Its then an easy matter of switching on those repositories you want Travis-CI to monitor (eg. build, run tests, etc.)

Travis-CI in action

Whilst Travis-CI has been pointed to the the lsug-dojo/lsug-website repo on github via my account, no one got round to adding a Travis-CI configuration file. The down side of this is that those contributors to the lsug-dojo/lsug-website repository received an emailed error message each time something was pushed to the repository or a pull request was accepted.

Not having a working Travis-CI was also noticeable when reviewing pull requests, as Travis-CI talks to Github and lets it know that your projects have failed. It then up to you wether you still want to merge.

Screenshot taken from travis-ci blog

With a quick Google I found an example travis-ci configuration file for Play 2 framework. I just dropped in a new .travis.yml file into the lsug-website github repository and that triggered another travis-ci build. This time the test ran and passed!!

Screenshot taken from travis-ci blog

One benefit of using Travis-CI is to encourage the use of tests, it also gives information about the state of the github repository. This is especially useful when working with pull requests.

This is the first time I have used Travis-CI and it was really easy to configure. If you have any comments or ideas about this, please share them with the group or myself directly.

Thank you.
@jr0cket


This work is licensed under a Creative Commons Attribution 4.0 ShareAlike License, including custom images & stylesheets. Permissions beyond the scope of this license may be available at @jr0cket
Creative Commons License

London Scala Hackday Powered by Heroku

Saturday 27th saw a great hackday thanks to Robert Rees, The Guardian and members of the London Scala user group. The ambitious challenge was to build an community website where events, conferences, blogs, code repos and community discussions were all available from one place.

There are several websites out there that do a part of what a community needs, to this project is trying to help bring all that together in one place. So the grand plans include, pulling in content from event sites, publishing events to sites, register at events with a single touch and widely distribute your interest and attendance automatically.

Or just have fun hacking on some cool technology and learning something new.

Read More

Confluence Supports Scala and Clojure Development

Clojure and Scala are two very exciting functional programming languages on the Java virtual machine (JVM) which provide many of the features than Java7 and Java8 have been working toward. There has already been a lot of activity around these functional languages in the UK, from financial services clients, media companies and developers who want to keep ahead of the game, all are getting involved with these languages now. Some of the top jobs are even mentioning these technologies by name.

With a long history of support for open source projects, it is no surprise that Atlassian support the development of Clojure and Scala by providing Confluence and JIRA to the project teams and wider community.

Read More

Creating a New Project for the London Scala Coding Dojo

On the third Thursday of the month the London Scala user group runs a Scala coding dojo at Thoughtworks office. The event has a great atmosphere and is a really fun and friendly place to learn and practice the Scala programming language (and some TDD / BDD).

For the Scala coding dojo I use the Simple Build Tool (SBT) to create a new scala project as well as run the building and testing of that project during the dojo.

Read More

London Scala User Group - Coding Dojo

A coding dojo is a form of deliberate practice where you are concerned with improving your software development approach and language skills. The aim of the Scala coding dojo is to learn how to think in terms of the Scala language and functional programming constructs. The reward from a Scala coding dojo is in that you feel more capable with the language and you learn a little (or a lot) more each time.

Read More

Compilation Daemon Issue Running Scala on Ubuntu

When running Scala on Ubuntu Linux, scala myscript.scala, if the network configuration in your /etc/hosts file does not have a loop back address you can experience the following error:

Could not connect to compilation daemon.

Edit your /etc/hosts file, gksudo gedit /etc/hosts and ensure there are the following lines at the top of the file:

127.0.0.1 localhost
127.0.0.1 mycomputer

Where mycompter is the name you gave your Ubuntu computer when you installed it.

It would seem that the scala compilation daemon does not pick up the network address when running scripts. The same problem occurs when there is no network, but I have not found a workaround as yet (except to find a wireless hotspot).

Thank you.
@jr0cket


This work is licensed under a Creative Commons Attribution 4.0 ShareAlike License, including custom images & stylesheets. Permissions beyond the scope of this license may be available at @jr0cket
Creative Commons License

Scala Dojo Setup Details - LSug Coding Dojo

The London Scala user group are holding monthly dojo events to help everyone get to grips with this exciting new language implementation for the Java Virtual Machine (JVM). A coding dojo is a practial event where everyone decides on a challenge or technology to try out, then getting into groups to code up an application. The coding dojo concludes with each team doing a show-n-tell of what app they have created and any lessons learnt.

Here are some details of how we set up the tools to help with the London Scala user group coding dojo.

Read More

Scala Development in Netbeans and Ubuntu (And MacOSX)

The Netbeans IDE is a pretty lightweight but easily extensible IDE for different languages that run on the Java Virtual Machine (JVM):

  • Java - native support
  • Groovy - native support
  • Scala - plugin - works with Scala 2.8
  • Clojure - plugin called enclojure

This article covers setting up Scala in Netbeans 6.8 in Linux (works on MacOSX too) - includes installing Scala 2.8, check out the Netbeans guide for Mac and Windows installs and other tips.

Read More