DeployHub’s Plug-In for Jenkins

DeployHub is a very sophisticated tool which allows the deployment of software across the enterprise. A DeployHub Application is deployed to an Environment which contains one or more Endpoints. An Application contains Components, which in turn contain Components Items, which access Repositories that contain all the files that are deployed. Both Applications and Components also contain Procedures and Functions, which can be executed before and after each Application deployment, and each Components contained within it. This pre and post logic gives DeployHub a tremendous amount of flexibility, whether it’s used alone or in tandem with Jenkins as a plug-in.


The DeployHub plug-in allows Jenkins to call DeployHub as a step in a job. This enables Jenkins to deploy files, which are typically the result of a compile step, using the sophisticated methods available in DeployHub. The DeployHub plug-in is displayed in the Jenkins Configure window, and provides a way to configure what is required from DeployHub. The basic configuration, which shows under the title “Use DeployHub to run a deployment”, includes the following:


Username and Password

Determines security access to the various objects within DeployHub, including the Applications and Components that are available from the Jenkins Plug-In.

Target Environment

A DeployHub Environment contains all the Endpoints that will be deployed to.

Application

A DeployHub Application contains all the Components that make up a deployment. It is deployed against an Environment.

Wait for Deployment to Complete

This tells Jenkins to wait until DeployHub is finished with the deployment before moving on to the next step in the Job. If this option is chosen, the remaining steps in the Job will only run if the deployment was successful. If left unchecked, Jenkins will continue to the next step in the Job as soon as DeployHub begins the deployment and ignore the success or failure of the deployment.



Advanced Application Selection Options

Use Advanced Version Selection

If this is checked, other options will appear that will allow you to take advantage of the capabilities that are available with Applications within DeployHub. These include:


Find Latest Version

If an Application Base Version has one or more Application Versions associated with it, this will cause the deployment to use the latest Application Version that was created. Otherwise, the Application Base Version will be used. Included with this is the optional Branch Name field. If this is filled in, the value will be used to determine the Application Version to use based on the name of the Branch. Within DeployHub, Application Versions can branch off from an Application Base Version, and these branches can be given a name.


If Latest Version is approved, create a new version

If this is checked, a new Application Version is created within DeployHub if the latest Application Version has been approved. In DeployHub, Application Versions can only be created by a Create Version Tasks, and these can only be executed by Users who have access to the Domain or Life Cycle Sub-Domain where the Application Version and Create Version Task are located. A User without access to a Create Version Task can use a Request Task to ask Users with access to approve the Create Version Task. A User with access to the Domain or Life Cycle Sub-Domain can execute an Approve Task, and the requesting User can then execute the Create Version Task. However, with the DeployHub plug-in within Jenkins, a new Application Version is created if the following takes place:


       The “If Latest Version is approved, create a new version” checkbox is checked in the DeployHub plug-in in Jenkins.

       The Create Version Task Name field, located below the “If Latest Version is approved” field, is filled in with the name of a Create Version Task within DeployHub.

       A User has executed an Approve Task against the Create Version Task (a Request Task is not required for an Approve Task to be executed).


The newly created version is then deployed. The version that existed prior to the creation of the new Application Version is not. This instead is typically moved to another Lifecycle Domain within DeployHub. The Create Version Task action is executed regardless of which User executed the Approval Task.

NOTE:  DeployHub Team has only two User Groups, Administrators and Users.  Upgrade to DeployHub Pro if more granular User Groups are required.  DeployHub Pro allows you to create as many different security groups levels as needed.

Use Components Selection

If this is selected, the name of the Components should be entered into the Component Name field, otherwise an error will occur. By filling this in, a new Component Version is created if it’s associated with an Application that has been approved (see earlier explanation about approved Applications). Once this is done, attributes can be created for the Components Version.

Set Components Attributes

Attributes can be created and their values changed within the plug-in, and these are passed to DeployHub. Each attribute is similar to a variable in a programming language, and has a Name and a Value. Common uses of this would be for keeping track of Jenkins Builds, placing files into or retrieving files from directories and Repositories, and anything that allows DeployHub to communicate with Jenkins during a build. A typical use for an attribute is to pass the Jenkins build number to DeployHub. The Jenkins global variable BUILD_NUMBER is used for this, so that the Attribute Name could be BLD_NUM, and the attribute value would be ${BUILD_NUMBER}. DeployHub would then use the value passed as BLD_NUM in order to store or retrieve files from a Repository, copy or retrieve files to a one of a series of directories named by build number, etc.

Set Application Attributes

The Add Attribute Button can be used to add as many Components attributes as desired. Below that the Set Application attributes allows the same thing for Applications.