heroku / heroku-jenkins-plugin

DEPRECATED: A plugin for interacting with Heroku during Jenkins builds
45 stars 9 forks source link

This project is DEPRECATED!

The recommended alternative is the Heroku Maven Plugin or the Heroku sbt Plugin (depending on what build tool you are using). The Heroku DevCenter has an article that describes using the sbt plugin with Jenkins, but the approach for the Maven plugin is similar in principle.

Heroku Jenkins Plugin

A plugin for interacting with Heroku during Jenkins builds.

Installing

This plugin is available in the Jenkins plugin manager. To install in Jenkins, go to Manage Jenkins | Manage Plugins | Available | Heroku Plugin for Jenkins | Install. You must restart Jenkins to complete the installation.

Configuration

The Heroku API key used by build steps can be configured either with a global default or for individual build steps. To configure a global default API key, go to Manage Jenkins | Heroku | Default API Key. This key will be used by Heroku build steps unless otherwise overridden. If no global default is specified, individual build steps must specify their own API keys under their respective Advanced settings. Your Heroku API key can be obtained from your Heroku account page.

All build steps also include the following fields:

Buildsteps

WAR Deployment

The Deploy WAR Artifact build step deploys a WAR file generated by your build directly to a Heroku app.

To deploy a WAR file, first make sure your build is successfully creating a deployable WAR file. If you are using Maven with <packaging>war</packaging>, the mvn package command will output the WAR file into its target directory. Otherwise, create the WAR file in whatever way is approiate for your build.

After the WAR file is created, add the Heroku: Deploy WAR Artifact build step to your under the Jenkins build configuration and specify the relative path to the WAR file created in a previous build step to deploy.

Set Configuration

The Set Configuration build step adds or updates config vars to the specified app.

Scale Process

The Scale Process build step scales a process type to a specified quantity.

Run Process

The Run Process build step runs a one-off process on a dyno.

Rollback

The Rollback build step rolls back to the previous release.

Restart

The Restart build step restart the specified app.

Maintenance Mode

The Maintenance Mode build step toggle maintenance mode for a given app.

Building & Installing from Source

  1. Follow instructions on setting up your environment from Jenkins

  2. This plugin has a dependency on direct-to-heroku-client, which is not yet in Maven central. To build this plugin, you must first build the client from source:

    git clone git://github.com/heroku/direct-to-heroku-client-java.git

    mvn clean install -DskipTests

  3. Build the plugin:

    git clone git://github.com/heroku/heroku-jenkins-plugin.git

    mvn clean package -DskipTests

    or with tests:

    mvn clean package -Dheroku.apiKey="<test user api key>" -Dheroku.appName="<test app>"

  4. This will create a *.hpi file in the target directory.

  5. On your Jenkins instance, go to Manage Jenkins | Manage Plugins | Advanced | Upload Plugin.

  6. Choose the generated *.hpi file and click upload.

  7. Restart Jenkins.

Changelog

Version 0.7.1 (October 28, 2012)

Version 0.7 (August 23, 2012)

Version 0.6 (July 27, 2012)

Version 0.5 Beta (June 27, 2012)

Version 0.4 Beta (June 22, 2012)

Version 0.3 Beta (June 2, 2012)

Version 0.2 Beta (May 15, 2012)

Version 0.1 Beta (May 8, 2012)