Skip to end of metadata
Go to start of metadata

Plugin Information

View OpenShift Deployer on the plugin site for more information.

The current version of this plugin may not be safe to use. Please review the following warnings before use:

OpenShift Deployer Plugin

This plugin add the ability to create gears and deploy applications to OpenShift.

Insallation

This plugin is available in the Jenkins plugin manager.
To install in Jenkins, go to Manage Jenkins | Manage Plugins | Available | OpenShift Deployer Plugin | Install.

You must restart Jenkins to complete the installation.

Plugin Configuration

SSH keys are essential when working with OpenShift. If no SSH keys exist on the Jenkins server, follow these instructions to generate a pair:

su jenkins -s /bin/sh
ssh-keygen -t rsa

In order to configure the OpenShift Deployer plugin, go to Manage Jenkins | Configure System | OpenShift. Enter the path to the public key (defaults to /var/lib/jenkins/.ssh/id_rsa.pub').

Add an OpenShift Server block for each OpenShift server you want to deploy to by specifying an arbitrary name, broker address, username and password. Click on Check Login to test the authentication. If successful, you can upload your SSH Public Key to the OpenShift server by clicking on Upload SSH Keys. The broker address is by default openshift.redhat.com which is the address of broker for http://www.openshift.com.

Job Configuration

When building the WAR/EAR file by Maven, make sure your build is successful creating a deployable file. The mvn package command creates the WAR/EAR file into its target directory. Otherwise create the WAR/EAR in whatever way that is appropriate for you project. The can also create a TAR archive containing the deployment packages, markers, scripts, etc and use the BINARY deployment method. Check out this blog post for further details on BINARY deployment.

In order to deploy an application to OpenShift during a build job, click on Add post-build step in the job configuration and choose OpenShift: Deploy Application.

The Deploy Application build-step creates an application on OpenShift and deploys the WAR/EAR/TAR file generated by your build to the created application. It also supports giving a URL (e.g. to Nexus or Artifactory) for the WAR, EAR or TAR deployment which will be fetched and deployed to OpenShift. 

In order to enable auto-scale, set environment variables and choose gear profile, click on the "Advanced" button.

When the build-step runs, if the specified application does not exist on OpenShift it is created first and then the WAR/EAR/TAR file is deployed to it. If it already exists, the packages will be deployed to the existing application.

The Delete Application build-step removes an existing application from OpenShift.

Release Notes

Version 1.2.0
  • Support for providing .openshift content in GIT deployments
  • Support for running on Slave nodes
  • OpenShift password encryption in Jenkins configurations
Version 1.1.1
  • Path to deployment package can be specified both as directory and file paths e.g. target/app.war
Version 1.1.0
  • Binary deployment support added
  • Plugin can create auto-scaled gears
  • Environment variables can be set on the gear
Version 1.0.4
  • Build-step added for removing applications on OpenShift
  • Empty domain accepted if only one domain exists on the user account
Version 1.0.3
  • Support for token macro expressions added for the deployment package URL
Version 1.0.2
  • Bug fixes to skip creating application if no deployment package exists.
Version 1.0.1
  • Support for deploying multiple deployments at once
  • Support for using URLs to fetch the deployment packages
Version 1.0.0
  • Initial release

1 Comment

  1. I get this error when using open shift deployment plugin, If anyone has any input please let me know.ERROR: OPENSHIFT No Deployments found! (configuredValue: target/)
    ERROR: OPENSHIFT hudson.AbortException
    at org.jenkinsci.plugins.openshift.util.Utils.abort(Utils.java:100)
    at org.jenkinsci.plugins.openshift.DeployApplication.findDeployments(DeployApplication.java:309)
    at org.jenkinsci.plugins.openshift.DeployApplication.perform(DeployApplication.java:107)
    at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
    at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.build(MavenModuleSetBuild.java:906)
    at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:857)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
    at hudson.model.Run.execute(Run.java:1738)
    at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:410)

    channel stopped
    Finished: FAILURE

    Thank you.
    MK