SBT runner for TeamCity

If you use the power of Scala in your projects then we have news you may find interesting.

We have created a plugin for TeamCity that natively supports SBT builds which means you can build the code and run tests with TeamCity and see the results in a handy way. When SBT runner is installed into your TeamCity server all you need is to pick ‘Simple Build Tool (Scala)’ runner when creating a new build step for your build configuration. Default ‘Auto’ installation mode provides latest version of SBT on every TeamCity agent your build will be running on. No additional actions from your side are required. Add the commands you like to run and enjoy the results.

Auto mode

If something goes wrong, e.g. compilation errors occur or tests fail, you will see the details in an easy to read form.

error in compilation

tests view

If you have pre-installed SBT manually you can choose ‘Custom’ mode and specify path to SBT home directory.

Custom mode

In this mode you need to install sbt-teamcity-logger either as a plugin for your project or as a global plugin for your SBT installation. You can find more details on GitHub.

In fact, the whole support for SBT builds consists of two independent parts.

  1. TeamCity plugin that provides convenient way of setting up build step for the configuration, and

  2. SBT plugin that wraps SBT native messages in the way TeamCity can consume and understand.

In case you cannot install the plugin to your TeamCity server, you still have a way to get reporting for SBT builds. Add sbt-teamcity-logger to your project or SBT installation as mentioned above and create ‘Ant’ build step that will run SBT as a regular java process. Build results will be shown in handy way.

SBT runner is available for the latest TeamCity versions. Download it for TeamCity 8.0 or for TeamCity 8.1. Try it out and let us know what you think!.

This entry was posted in Features. Bookmark the permalink.

4 Responses to SBT runner for TeamCity

  1. Clint Munden says:

    I am trying out the SBT Runner plugin (for TeamCity 8.1) but I get the following message when adding builds to the queue “Incompatible runner: Simple Build Tool (Scala)”. The build sits in the queue and doesn’t start any of my TeamCity cloud agents.

    What am I missing?

    Best Regards,
    Clint Munden

  2. Justin says:

    I’m currently evaluating TeamCity with sbt, but I can’t quite get this sbt runner to work. The auto mode runs, but won’t detect my settings in ~/.sbt, which I require for resolver config and publish credentials.

    For the custom config, it is not clear to me how to set it up. I tried using both the sbt directory installed on the system by yum as well as a version installed in the home directory.

    • Ekaterina Shliakhovetskaja says:

      Hi Justin,

      Thank you for giving TeamCity a chance :)
      In ‘Auto’ mode the SBT runner downloads latest SBT version and runs it in isolation, so no your local configs are used. In ‘custom’ mode you should provide a path to SBT installation directory located on the agents where the build will be running. SBT runner will launch ‘sbt-launch.jar’ from /bin folder under that directory. Default Java options that will be used you can see and change within SBT runner build step settings. SBT itself will use ~/.sbt directory for further configs. At the moment we don’t support running sbt with command line script but we are considering it ( http://youtrack.jetbrains.com/issue/TW-34977).
      You can contact me directly at shkate at jetbrains if you have other questions.

      Regards,
      Kate

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">