Micro Focus Deployment Automation Plugin Template

0 Likes

One of the unique and maybe best features of Micro Focus Deployment Automation is its architecture that allows you the ability to create your "plugins" with limited coding knowledge. In this post we look at an example template that you can use to create your own plugins.


I have placed the template over on GitHub, to get started you will need to clone the repository using the following command:

git clone https://github.com/sda-community-plugins/plugin-template.git

This is a fully documented template that can use to make your own Micro Focus Deployment Automation plugin from. It illustrates how to achieve the following in your own plugin:

  • prompt for and retrieve the value of all types of properties in a step
  • set a property output for a step
  • check if your step is running on Windows or Unix/Linux
  • execute a command line program
  • call a REST API
  • parse the output of command line programs to determine success or failure
  • use the plugins-commons library to simplify your code
  • upgrade a plugin's version when adding or renaming properties and steps

Additional product documentation is provided in the Integration Guide. It is recommend that you read Chapter 7 in this document before you start writing your own plugin.

Creating your own plugin

To create your own plugin, copy or clone this repository and then update the following files and directories:

  1. pom.xml
    change the artifactId, name and description elements for your own plugin.

  2. src\main\groovy\:
    create any new groovy classes you want to use across multiple plugin steps here

    see ExampleCLIHelper.groovy and ExampleRESTHelper.groovy for some examples.

  3. src\main\zip\:
    create a new .grooyy file for each step you create.

    add an entry into plugin.xml for each new step (see below).

  4. src\main\groovy\zip\plugin.xml:
    change the element to refer to your plugin's id and name.

    change the element's attribute if you have released your plugin before (or installed it into Deployment Automation) and are now creating a new version.

    change the element.

    change the element to where you want your plugin to appear in the workflow designer palette. It is recommended that you try and keep it in the structure that has already been created.

    add additional elements making sure that the element refers to the new file you have created for your step.

  5. src\main\groovy\zip\info.xml:
    this file is only used for documentation purposes but you can change the information in here for completeness.

  6. src\main\grooy\upgrade.xml:
    you need to add entries in here when you create a new version of your plugin so that existing processes can be upgraded successfully you can specify new steps, renamed steps or properties - see the example provided

Building the plugin

To build the plugin you will need to clone the following repositories (at the same level as this repository):

mavenBuildConfig

plugins-build-parent

air-plugin-build-script

and then compile using the following command:

mvn clean package

This will create a .zip file in the target directory when you can then install into Deployment Automation from the System\Automation page.

 

 

Labels:

How To-Best Practice
Comment List
Anonymous
Related Discussions
Recommended