Giter Site home page Giter Site logo

heroku-jenkins-plugin's Introduction

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:

  • API Key: Your Heroku API key to use for deployment. This is only required if a global default is not already configured. Your Heroku API key can be obtained from your Heroku account page.
  • App Name: The app to which to deploy. If the app exists, you must have access to deploy new releases. If the app does not exist and the name is not already taken, it will be created for you.

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)

  • Fixed issue with app name not appearing in Maintenance Mode build step

Version 0.7 (August 23, 2012)

  • API Key field in Advanced section of build steps
  • Send Feedback links in build step
  • Improved error handling of authentication issues
  • Standardization of build output and alignment with the Heroku CLI client
  • Deprecated Workspace Deploy build step
  • Changed to Jersey Client HTTP/JSON provider
  • Upgraded to heroku-api 0.12

Version 0.6 (July 27, 2012)

  • New Restart build step
  • New Set Configuration build step
  • Upgrade to direct-to-heroku-client 0.6-BETA

Version 0.5 Beta (June 27, 2012)

  • New Maintenance Mode build step
  • Upload message during artifact deployment
  • Upgrade to heroku-api 0.11
  • Upgrade to direct-to-heroku-client 0.5-BETA

Version 0.4 Beta (June 22, 2012)

  • New Build Steps
    • Workspace Deployment
    • Scale Process
    • Run Process
    • Rollback
  • Upgrade to heroku-api 0.9

Version 0.3 Beta (June 2, 2012)

  • Support for master-slave setups

Version 0.2 Beta (May 15, 2012)

  • Upgrade to heroku-api 0.8
  • Upgrade to direct-to-heroku-client 0.4-BETA
  • First release to jenkins-ci.org

Version 0.1 Beta (May 8, 2012)

  • WAR Deployment

heroku-jenkins-plugin's People

Contributors

jkutner avatar recampbell avatar ryanbrainard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

heroku-jenkins-plugin's Issues

Provide a Heroku Git push deployment

IT would be nice to deploy to heroku with git push --force option, since this is not available in the git plugin

Configuration that needs to be specified is the local branch that should be pushed to heroku

App named not saved

Created a job just to disable maintenance mode for an app. After putting in the app name, api key, and the save button, I can return to the project config and see the app name missing.

Add 'heroku restart'

Workaround is to use bash 'heroku restart' but with that one can get a heroku account conflict with other jobs that are executed on same jenkins. Executing this as a bash shell assumes I am logged in to heroku, and so only one account can be logged in at a time. Having that option in heroku plugin would allow me to specify a API key per jenkins job.

I tried Run Heroku process with value 'restart' but that does not work as what is needed is 'heroku restart' not heroku run restart'

Add Post Build Actions and Jenkins Environment variables usage.

I like using the Heroku-Jenkins plugin. This is more of a feature request. Can we invoke Heroku Plugin options aslo available in post Build Actions.

Another request is also allow to use Jenkins Environment variable for example in: "App Name" I would like to use my workspace name ( $JOB_NAME) as my "App Name".

Deploy error

I'm trying deploy and rises this error.


FATAL: failed:Deployment is not enabled for this Heroku account. Please email [email protected] to have it enabled.
com.herokuapp.directto.client.DeploymentException: failed:Deployment is not enabled for this Heroku account. Please email [email protected] to have it enabled.

Can you help me?

Deprecated

I see that this is deprecated. I would like to know what your recommendations would be for my use case. I am only using this plugin to run processes as a build step. I am currently using a hosted cloudbees jenkins instance, because of this I don't have the luxury to install the heroku client easily on the jenkins server. Is there a different plugin that i'm not seeing that will do this same thing?

On a side note the issue #18 can be worked around by using templates.
I would also like to report that the run process does not propagate the return code so if a process fails the build step still passes.

Saved App Name Not Appearing Job Definition

this is happening intermittently where the name is not showing up in the job definition after saving. the name is actually being used in the build, but not appearing in the UI.

Artifact Deployment Fails with Master-Slave Setup

Found existing app: jenkins-master-slave-test
Preparing to deploy WAR to jenkins-master-slave-test
ERROR: remote file operation failed: /Users/brainard/Development/jenkins-slave-rfs/workspace/sample-job at hudson.remoting.Channel@c6f558a:my-slave
hudson.util.IOException2: remote file operation failed: /Users/brainard/Development/jenkins-slave-rfs/workspace/sample-job at hudson.remoting.Channel@c6f558a:my-slave
        at hudson.FilePath.act(FilePath.java:835)
        at hudson.FilePath.act(FilePath.java:821)
        at com.heroku.AbstractArtifactDeployment.perform(AbstractArtifactDeployment.java:40)
        at com.heroku.AbstractHerokuBuildStep.perform(AbstractHerokuBuildStep.java:94)
        at com.heroku.AbstractArtifactDeployment.perform(AbstractArtifactDeployment.java:25)
        at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
        at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:710)
        at hudson.model.Build$RunnerImpl.build(Build.java:178)
        at hudson.model.Build$RunnerImpl.doRun(Build.java:139)
        at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:480)
        at hudson.model.Run.run(Run.java:1438)
        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
        at hudson.model.ResourceController.execute(ResourceController.java:88)
        at hudson.model.Executor.run(Executor.java:239)
Caused by: java.io.IOException: Unable to serialize hudson.FilePath$FileCallableWrapper@5e9ed2e4
        at hudson.remoting.UserRequest.serialize(UserRequest.java:166)
        at hudson.remoting.UserRequest.<init>(UserRequest.java:62)
        at hudson.remoting.Channel.call(Channel.java:645)
        at hudson.FilePath.act(FilePath.java:828)
        ... 13 more
Caused by: java.io.NotSerializableException: com.heroku.WarDeployment
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164)
        at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
        at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
        at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
        at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
        at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
        at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
        at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
        at hudson.remoting.UserRequest._serialize(UserRequest.java:155)
        at hudson.remoting.UserRequest.serialize(UserRequest.java:164)
        ... 16 more
Build step 'Heroku: Deploy WAR Artifact' marked build as failure
Finished: FAILURE

ClassCast exception

Reported by a developer at Macys

We are currently using the heroku-jenkins plugin to deploy our war file to apps in heroku. The jenkins job fails with the following error message. However it does appear to deploy the war file as I see the timestamp on heroku updated. Could you please take a look at this or open a defect if necessary.

If you are also curious how we are using glassfish you can take a look at the code that is pushed to the application "radiant-light-9384" The java file to start glassfish is called StartGlassfish.java

Thank you
Viddu

[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 20 seconds
[INFO] Finished at: Wed Jun 27 08:06:37 PDT 2012
[INFO] Final Memory: 67M/972M
[INFO] ------------------------------------------------------------------------
channel stopped
Found existing app: macys-canvas-ci
Preparing to deploy WAR to macys-canvas-ci
Adding war => MacysFacebookCanvasApp/target/MacysFacebookCanvasApp.war
Deploying...
message:created release
release:v52
ERROR: Processing failed due to a bug in the code. Please report this to [email protected]
java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
at com.heroku.AbstractArtifactDeployment$RemoteCallable.invoke(AbstractArtifactDeployment.java:112)
at com.heroku.AbstractArtifactDeployment$RemoteCallable.invoke(AbstractArtifactDeployment.java:68)
at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2045)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:287)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at hudson.remoting.Engine$1$1.run(Engine.java:60)
at java.lang.Thread.run(Thread.java:636)
project=hudson.maven.MavenModuleSet@1f421ab0[SocialShoppingApps_HerokuDeploy]
project.getModules()=[hudson.maven.MavenModule@7544497e[SocialShoppingApps_HerokuDeploy/com.macys.social:BloomiesFacebookCanvasApp][SocialShoppingApps_HerokuDeploy/com.macys.social:BloomiesFacebookCanvasApp][relativePath:BloomiesFacebookCanvasApp], hudson.maven.MavenModule@3a8393ef[SocialShoppingApps_HerokuDeploy/com.macys.social:CanvasAppLauncher][SocialShoppingApps_HerokuDeploy/com.macys.social:CanvasAppLauncher][relativePath:CanvasAppLauncher], hudson.maven.MavenModule@1d56dbdd[SocialShoppingApps_HerokuDeploy/com.macys.social:FacebookCanvasApp-common][SocialShoppingApps_HerokuDeploy/com.macys.social:FacebookCanvasApp-common][relativePath:FacebookCanvasApp-common], hudson.maven.MavenModule@379f167a[SocialShoppingApps_HerokuDeploy/com.macys.social:MacysFacebookCanvasApp][SocialShoppingApps_HerokuDeploy/com.macys.social:MacysFacebookCanvasApp][relativePath:MacysFacebookCanvasApp], hudson.maven.MavenModule@2884c5ae[SocialShoppingApps_HerokuDeploy/com.macys.social:SocialShoppingApps][SocialShoppingApps_HerokuDeploy/com.macys.social:SocialShoppingApps][relativePath:]]
project.getRootModule()=hudson.maven.MavenModule@2884c5ae[SocialShoppingApps_HerokuDeploy/com.macys.social:SocialShoppingApps][SocialShoppingApps_HerokuDeploy/com.macys.social:SocialShoppingApps][relativePath:]
FATAL: java.lang.Integer cannot be cast to java.lang.String
java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
at com.heroku.AbstractArtifactDeployment$RemoteCallable.invoke(AbstractArtifactDeployment.java:112)
at com.heroku.AbstractArtifactDeployment$RemoteCallable.invoke(AbstractArtifactDeployment.java:68)
at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2045)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:287)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at hudson.remoting.Engine$1$1.run(Engine.java:60)
at java.lang.Thread.run(Thread.java:636)

Heroku process not executed

After configuring heroku process in the job it does not get executed correctly without a meaningful message:

Running play evolutions:apply --%prod. State: null. Output:
bash: play: command not found

Running restart. State: null. Output:
bash: restart: command not found

In the job the commands are:

play evolutions:apply --%prod
restart

trying to copy build artifacts to heroku

Hi

i'm actually building some opensource package from github public repository, so I'm trying to copy those build artifacts from jenkins to heroku at build step using copy artifacts to heroku.

i'm getting error

=== Starting Heroku: Deploy WAR Artifact ===
Preparing to deploy WAR to sheltered-lowlands-3501...
Uploading...
Deploying...
ERROR: Build step failed with exception
com.herokuapp.directto.client.DeploymentException: failed:Failed to Realse App statuscode:422

can you suggest how to configure heroku app for deployment activities.

Add "config:add" to plugin

The use case could be injecting environment configurations as part of a Build/Deploy lifecycle. doing this manually is very cumbersome when you have a lot of environments to deal with.

JDK version

How can I specify system.properties file ?
I need it to specify JDK 1.8 version.

Thanks.

setting path to Procfile

I have seen it in the code, but cannot edit the path to the Procfile from jenkins.
would be great to have this option

(for now: what is the default one? Procfile in the main-war-archive doesn't get picked up)

thank yout

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.