Deployment Automation Jenkins plugin

The Deployment Automation Jenkins HPI (JPI) plugin enables you to publish artifacts to Deployment Automation, run application and global processes, and update artifact statuses in Deployment Automation as part of a Jenkins job.

Install the plugin on your Jenkins CI (Continuous Integration) server, set up the connection to Deployment Automation, and add the DA Deploy post-build actions to your Jenkins build.

Install the plugin on Jenkins

The Deployment Automation Jenkins plugin is available on the Micro Focus Marketplace.

Note: The Deployment Automation Jenkins plugin works with Deployment Automation 6.2.0 and later.

To install the Deployment Automation Jenkins plugin:

  1. Download the plugin zip file from the Micro Focus Marketplace.

  2. Extract the hpi file from the zip file.

  3. In Jenkins, navigate to Manage Jenkins > Manage Plugins > Advanced.

  4. In the Upload Plugin section, upload the plugin hpi file.

  5. Restart Jenkins.

    When loaded, the plugin is displayed in the list of installed plugins as DA Deploy for Jenkins.

After you install the plugin, configure the connection to your Deployment Automation server.

Back to top

Configure the connection to Deployment Automation

Before you can use the plugin, you need to configure Jenkins to connect to your Deployment Automation server.

To set up the connection to Deployment Automation:

  1. In Jenkins, navigate to Manage Jenkins > Configure System.
  2. Enter your DA server details:

    Setting Description
    Profile name The name for the Deployment Automation server.
    DA URL The path to the Deployment Automation server, for example, http://localhost:8080/da.
    User Name Your login for connecting to the Deployment Automation server.
    Password Your password for connecting to the Deployment Automation server.
  3. Click Test Connection.
  4. If the connection is successful, click Save to save the configuration.

Caution: When you run a job with the DA Deploy steps on a Jenkins agent, the agent may fail to connect to Deployment Automation. To avoid the connection error, follow these steps:

  1. Navigate to Manage Jenkins > Configure System, retest the connection to the DA server, and resave the server details.

    Saving the DA credentials generates security keys for reliable data transfer. The keys are stored in the enc-keys directory on your Jenkins server.

  2. Copy the entire enc-keys directory from the Jenkins server's installation location to the agent's directory containing the agent.jar file.

After you install the plugin and configure the connection to the Deployment Automation server, you can add post-build actions to your Jenkins job to perform the following tasks:

Note: Jenkins initiates the DA Deploy post-build actions only if a build is successful.

Back to top

Publish artifacts to Deployment Automation

To upload a component version from Jenkins to Deployment Automation, add the Publish artifacts to DA post-build action to the Jenkins job.

When publishing artifacts, you can also add a status to the version or run an application or global process.

To publish artifacts to Deployment Automation:

  1. In Jenkins, open your project’s configuration. For details on how to create a Jenkins project, see the Jenkins documentation.

  2. Under Post-Build Actions, click Add post-build action and then select Publish artifacts to DA from the list.
  3. Add the following settings:

    Setting Description
    DA Server Enter the name of the connected Deployment Automation server.
    Component Specify the DA component to which you want to upload the artifacts.
    Base Artifact Directory (Optional) Specify the Jenkins directory from which to pull the artifacts.

    By default, the system uses the base directory of the workspace, ${WORKSPACE}.
    Directory Offset (Optional) Specify the subdirectory from which to pull the artifacts, relative to the base artifact directory.

    Enter the subdirectory only if you specified an incomplete path to the artifacts in the Base Artifact Directory field.
    Version Enter the name of the component version that Deployment Automation will create for the artifacts.

    Use variables for dynamic names. For example, to add a build number, use the BUILD_NUMBER variable: ${BUILD_NUMBER}
    Include/Exclude Provide a list of files you want to include in or exclude from the upload.

    Specify each entry on a new line. Use an asterisk (*) as a wildcard to include multiple files.
    Skip publishing (e. g. temporarily) Select this option if you need to temporarily run the build without publishing the artifacts. This way, you can save the post-build settings for later, when you decide to publish.
    Add status Select this option to add a status to the component version in Deployment Automation. To specify the settings, see Update version status.
    Deploy Select this option to run an application process in Deployment Automation. To specify the settings, see Run an application process.
    Run process Select this option to run a global process in Deployment Automation. To specify the settings, see Run a global process.
  4. Click Save.

After you run the build, check that the artifacts were transferred from Jenkins to Deployment Automation. In Deployment Automation, navigate to Management > Components. Select your component and verify that the new version with artifacts is present.

Back to top

Run an application process

To run an application process in Deployment Automation, add the Run application process in DA post-build action to your Jenkins job.

To run an application process:

  1. In Jenkins, open your project’s configuration. For details on how to create a Jenkins project, see the Jenkins documentation.

  2. Under Post-Build Actions, click Add post-build action and then select Run application process in DA from the list.
  3. Add the following settings:

    Setting Description
    DA Server Enter the name of the connected Deployment Automation server.
    Run Application Process if (Optional) Enter a Jenkins variable or a build parameter to set a condition for triggering the process in Deployment Automation.
    Update Job Status Select this option if you want Jenkins to wait for the results of the application process and then display the overall job status.
    Application Specify the DA application that will manage the process.
    Environment Define the DA environment for the application process.
    Application Process Specify the application process you want to run in Deployment Automation.
    Component Specify the DA component to be deployed.
    Application Process Properties

    (Optional) Change the values of existing application process properties.

    Make sure the property names match those in Deployment Automation. Enter each property on a new line in the name=value format, for example:

    prop1=${BUILD_NUMBER}

    For details on creating properties, see Add application process properties.

  4. Click Save.

After you run the build, check the deployment summary for the application. In Deployment Automation, navigate to Management > Applications. Select your application and review the summary.

Back to top

Run a global process

To run a global process in Deployment Automation, add the Run global process in DA post-build action to your Jenkins job.

To run a global process:

  1. In Jenkins, open your project’s configuration. For details on how to create a Jenkins project, see the Jenkins documentation.

  2. Under Post-Build Actions, click Add post-build action and then select Run global process in DA from the list.
  3. Add the following settings:

    Setting Description
    DA Server Enter the name of the connected Deployment Automation server.
    Run Global Process if (Optional) Enter a Jenkins variable or a build parameter to set a condition for triggering the process in Deployment Automation.
    Update Job Status Select this option if you want Jenkins to wait for the results of the global process and then display the overall job status.
    Global process Specify the global process you want to run in Deployment Automation.
    Resource Define the DA resource for the global process.
    Global Process Properties

    (Optional) Change the values of existing global process properties.

    Make sure the property names match those in Deployment Automation. Enter each property on a new line in the name=value format, for example:

    prop1=${BUILD_NUMBER}

    For details on creating properties, see Add global process properties.

  4. Click Save.

After you run the build, verify the results for the global process. In Deployment Automation, navigate to Management > Processes. Click the Details icon next to your global process and review the results in the Requests tab.

Back to top

Update version status

To add, change, or remove the status of a component version in Deployment Automation, add the Update artifacts status in DA post-build action to your Jenkins job.

To update the artifacts status:

  1. In Jenkins, open your project’s configuration. For details on how to create a Jenkins project, see the Jenkins documentation.

  2. Under Post-Build Actions, click Add post-build action and then select Update artifacts status in DA from the list.
  3. Specify the following settings:

    Setting Description
    DA Server Enter the name of the connected Deployment Automation server.
    Action

    Select your option:

    • To add or change the status, select Add.
    • To clear the status, select Remove.

    For details on creating statuses in Deployment Automation, see Define and use statuses.

    Component Specify the DA component that contains the target version.
    Version Specify the target version for which you want to update the status.
    Status Name Enter the version status you want to set or remove.
    Make sure the name matches an existing Deployment Automation status. If the status doesn’t exist, the build fails.
  4. Click Save.

After you run the build, verify the artifacts status. In Deployment Automation, navigate to Management > Components > [select component] > Versions. Check the latest status for your version.

Back to top

See also: