Heroku

Add-On Installation

To use Solano CI with your Heroku app, install the tddium add-on:

$ heroku addons:add tddium
$ heroku addons:add tddium --app  # if you don't have a default

Solano CI Gem Installation

Next, in your local environment, install the solano gem.

$ gem install solano

Activate Solano CI Account

Next, activate your Solano CI account using the solano heroku command. If you have the heroku gem installed, and you are logged in to heroku, the solano account command should automatically discover your addon configuration. If you have multiple heroku applications, use --app to specify your application.

$ solano heroku
$ solano heroku --app <myappname> # if you don't have a default
Thanks for using the Tddium Heroku Add-On!

Your Tddium user name is:  appNNNNNN@heroku.com

Enter a password:  ********
Confirm your password:  ********
Public key [~/.ssh/id_rsa.pub]:

Continue with the instructions from the solano heroku command to configure Solano CI for Continuous Integration, or for manual test execution.

Running tests with Solano CI

Solano CI automatically configures your test suite, selects your tests based on common filename patterns, and runs your application’s tests in the cloud when you run solano run.

Configuring Solano CI on Heroku

You can configure Solano to run a CI build when triggered by a POST request. Solano CI will ask you for git URLs to pull from and push to; don’t worry about whether Solano CI has access yet, as it will provide you an SSH key to authorize later on.

The URL to pull from should be your application’s github repository:

Enter git URL to pull from (default 'git@github.com:ghUser/myappname.git'):

Since you’re already using Heroku, we recommend that you create a second application to stage the CI pushes. We’‘ll assume you have a second application called myappstage for this purpose.

Enter git URL to push to (default ''): git@heroku.com:myappstage.git

You should now see a summary report like this:

Solano CI is enabled with the following parameters:

Pull URL: git@github.com:ghUser/myappname.git
Push URL: git@heroku.com:myappstage.git

Notifications:
  Email: appNNNNNN@heroku.com

Authorize the following SSH key to let Solano CI's pulls and
pushes through:

ssh-rsa AAAA.... ci-

To trigger CI builds, POST to the following URL from a post-commit hook:

http://hooks.solano.com/1/builds/longpostcommithookstring

Authorize Solano CI to push and pull

Now you need to authorize Solano CI’s key to pull from your git repository.

See the Solano CI support guide for details.

If you are using Heroku as your continuous integration destination, Solano CI should also notice you are pushing to a Heroku app and display the Heroku command to add the deploy key.

The simplest way to configure Solano CI continuous deployment is to have it push to your staging or production Heroku app. You can also configure a custom post-build hook to, e.g. run migrations or capture a screenshot of the newly deployed code.

If for some reason your .solano-deploy-key file does not contain the displayed key, you can copy and paste the key into a temporary file and instruct Heroku to authorize it for the app you’re pushing to. Example:

$ cat > /tmp/key
ssh-rsa AAAA...blahblahEH ci-
$ heroku keys:add /tmp/key --app myappstage
Uploading ssh public key /tmp/key
$ heroku keys --app myappstage
=== 2 keys for myemail@domain.com
ssh-rsa AAAAB3NzaC...eyGmAhfQ== myemail@domain.com
ssh-rsa AAAAB3NzaC...blahblahEH ci-

Deployment issues

Solano CI does not automatically run migrations on your heroku app.

You can configure a post-build hook (as a rake task) that Solano CI will run after a successful build. See our documentation for more information.

Post-Build Hooks

For smooth continuous integration between your app, Solano CI, and heroku, you will need to turn off the git push URL in Solano CI when using a post-build hook.

Heroku Authentication through Solano CI

When using a post-build hook with heroku, you will need to pass your heroku login information in Solano CI.

There a few ways to pass your login credentials through Solano CI to your heroku account, depending on your security needs.

For further information: http://blog.solanolabs.com/2012/05/09/heroku-continuous-deployment/ Setting environment variables: http://docs.solanolabs.com/Setup/setting-environment-variables

More Information

For more information see the Solano CI online docs.