The CloudBees Gem for Deployment to RUN@cloud

We will be highlighting a few interesting frameworks and how to easily depl0y your apps to CloudBees with them with minimal fuss in upcoming blogs.

Ruby gems (rubygems.org) are a convenient way to use and distribute ruby dependencies (not unlike cpan for perl, or maven for java).

There is now a cloudbees gem which provides some helpers around the CloudBees SDK and more.

To do this, you will need the CloudBees SDK installed (this will be automated soon) for your platform, for example (rails):

gem install cloudbees
rails new myproject
cd myproject
cloudbees deploy

Answer any questions (it will ask what account/appname you want to deploy it to, and remember it for subsequent deploys), and you are up and running (it will create an app for you if it is is the first time - so you will see your app on appname.account.cloudbees.net).

How it works:

As all RUN@cloud apps are currently on the JVM, the warbler utility is used to package rack (eg rails) apps up into a war, whence the SDK can upload (or only upload the details) with all dependencies bundled inside it (don’t worry if the war gets big, only changes are sent) and deploy the application.

This works for any rack based ruby application. “Rack” is the name of ruby middleware for web apps, which maps nicely to the servlet model (which is what the jruby-rack library does).

Sinatra is a popular alternative to rails, a very minimalist framework and works very nicely as well - you just need to follow the examples, include a “config.ru” and a warbler.rb so it knows how to run your app.

Enjoy! And as always, check the knowledge base and feel free to post questions on the forum.