OpenShift Deployer Plugin
This plugin add the ability to create gears and deploy applications to OpenShift.
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.
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.
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.
- Support for providing .openshift content in GIT deployments
- Support for running on Slave nodes
- OpenShift password encryption in Jenkins configurations
- Path to deployment package can be specified both as directory and file paths e.g. target/app.war
- Binary deployment support added
- Plugin can create auto-scaled gears
- Environment variables can be set on the gear
- Build-step added for removing applications on OpenShift
- Empty domain accepted if only one domain exists on the user account
- Support for token macro expressions added for the deployment package URL
- Bug fixes to skip creating application if no deployment package exists.
- Support for deploying multiple deployments at once
- Support for using URLs to fetch the deployment packages
- Initial release