Software generalist, backend engineer, bit-herder, building distributed systems on the JVM for FullContact.

Dropwizard Deployment for the Lazy Using Rake and Net::SSH

Today I embarked on automated deployment of one of my basic Dropwizard/Angular.JS projects. This project’s purpose is to extract unstructured data from forum posts and turn them into data directly consumable by an API. It’s split into a four major pieces:

Extraction — Extracts data from forum posts by executing a large unwieldy JDBC query and iterating over the results, then pushing each into MongoDB

Query — Dropwizard/JAX-RS REST API for exposing the data found by the extraction phase

Frontend — Angular.JS frontend app that consumes the REST API

As with many projects, they all begin somewhat manually, but today I wanted to automate the deployment of my project. Jenkins is a little heavy weight for a personal project, and I don’t really need a full-blown continuous integration framework. Capistrano is more along the lines I wanted, but is too Rails-flavored to be immediately useful for my needs.

Rake

Rake is simple. Stupid simple. It’s a Ruby DSL for running commands, a step up from a hand-rolled bash script.

I had three goals: build the project, deploy the frontend, deploy the API. All three turned out to be simple. Deploying the API builds the project, runs tests, and deploys the uberjar via rsync.

Deploying the frontend simply rsyncs the site remotely. Eventually, it’ll compile assets and version them, but that’s another project. :)