This is an AMP version of the article, its original content can be found here.

Deploying to Heroku, in One Click

There were a few articles already about our usage of Rultor for automating continuous delivery cycles of Java and Ruby projects, including RubyGems, CloudBees and Maven Central.

This one describes how Heroku deployment can be automated. When I need to deploy a new version of an Aintshy web application, all I do is create one message in a GitHub ticket. I just say @rultor release 0.1.4 and version 0.1.4 gets deployed to Heroku. See GitHub ticket #5.

You can do the same, with the help of Rultor.com, a free hosted DevOps assistant.

Create Heroku Project

Create a new project at Heroku.com.

Then install their command line tool-belt.

Authenticate at Heroku

You should authenticate your public SSH key at Heroku, using their command line tool-belt. The process is explained here, but it is not much of a process. You just run heroku login and enter your login credentials. As a result, you will get your existing key (located at ~/.ssh/id_rsa.pub) authenticated by Heroku.

If you didn't have the key before, it will be created automatically.

Encrypt SSH Key

Now, encrypt id_rsa and id_rsa.pub (they are in the ~/.ssh directory) with a rultor remote:

Instead of me/test use the name of your GitHub project.

You will get two new files id_rsa.asc and id_rsa.pub.asc. Add them to the root directory of your project, commit and push. These files contain your secret information, but only the Rultor server can decrypt them.

Create Rultor Configuration

Create a .rultor.yml file in the root directory of your project (reference page explains this format in detail):

You can compare your file with live Rultor configuration of aintshy/hub.

Run It!

Now it's time to see how it all works. Create a new ticket in the GitHub issue tracker, and post something like this into it (read more about Rultor commands):

You will get a response in a few seconds. The rest will be done by Rultor.

Enjoy :)

BTW, if something doesn't work as I've explained, don't hesitate to submit a ticket to the Rultor issue tracker. I will try to help you.

PS. I would also recommend to versionalize artifacts through MANIFEST.MF and use jcabi-manifests to read them later.