Deployment Automation plugin for TeamCity

The Deployment Automation TeamCity plugin enables you to publish and deploy artifacts into Deployment Automation while running a TeamCity build.

Install the plugin into TeamCity and then create and configure the Micro Focus Deploy build step.

Install plugin into TeamCity

The Deployment Automation TeamCity plugin is available on the Software Licensing and Downloads portal (requires login).

To install the Deployment Automation TeamCity plugin:

  1. Download the plugin zip file, for example, MicroFocusDeploy-<version>_<index>.zip.

  2. In TeamCity, navigate to Administration, and select Plugin List under Server Administration.

  3. On the Plugin List page, click Upload plugin zip and upload the plugin file.

  4. Enable the plugin:

    • TeamCity 2018.2 and later: Click the plugin context menu and select Load.
    • TeamCity 2018.1.5 and earlier: Restart your TeamCity server.

When enabled, the plugin named Micro Focus Deployment Automation is displayed in the list of TeamCity’s external plugins.

Back to top

Add the Micro Focus Deploy build step

To publish and optionally deploy artifacts to Deployment Automation, add the Micro Focus Deploy step to your build in TeamCity.

To create the Micro Focus Deploy build step:

  1. In TeamCity, open your project’s build, or create a new one.
  2. In the side menu, select Build Steps, and then click Add build step. The New Build Step page opens.
  3. From the Runner Type list, select Micro Focus Deploy. The build step settings are displayed.
  4. Add the following settings:

    Setting Description
    Runner Type Defines how to run a build and report its results.
    You have already selected the Micro Focus Deploy runner type in the earlier step.
    Step Name (Optional) Enter a name to distinguish this step from others.
    Deployment Server Settings
    Micro Focus DA URL Specify the path to your Deployment Automation server, for example, http://localhost:8080/da.
    Username Enter your login for connecting to the Deployment Automation server.
    Password Enter your password for connecting to the Deployment Automation server.

    Make sure you have permission to upload and deploy versions in DA.
    Password Parameter (Optional) Specify a parameter to be used as a password to Deployment Automation. In this case, leave the Password field empty.

    For details on how to configure build parameters, see the TeamCity documentation.
    Version Upload Settings
    Publish Version (Optional) Select this option to upload the artifacts to Deployment Automation.
    Publish Version if (Optional) Enter a parameter that sets special conditions for uploading the artifacts, overriding the Publish Version setting.
    Component Enter the name of an existing DA component to which you want to upload the artifacts.
    Base Artifact Directory Specify the TeamCity directory that contains the artifacts.

    Leave this field empty to use the source directory of the build, %teamcity.build.workingDir%, as the default location.
    Directory Offset (Optional) Specify the subdirectory that contains 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 Name Enter the name of the new version to create for the artifacts.

    Use build parameters to create flexible names. For example, to include a build number, enter %build.number% next to the name.

    To publish the artifacts to an existing version, enter its name, as defined in Deployment Automation. Then select Add Files to Existing Version, as described in Configure advanced options.
    Includes/Excludes (Optional) Specify the list of files you want to include in or exclude from uploading.

    For multiple file filters, separate entries with a comma.
    Use wildcards to match directories and files. The wildcard ** indicates every directory, and the wildcard * indicates every file.

    To include all the files, leave both fields empty.
    Version Deployment Settings
    Deploy Version (Optional) Select this option to deploy the version in Deployment Automation.
    Deploy Application Enter the name of an existing DA application to manage the deployment.
    Deploy Environment Enter the name of an existing DA environment for deploying the artifacts.
    Deploy Process Enter the name of an existing Deployment Automation application process to run the deployment.

    Note: The system verifies the names of the component, application, environment, and process you specified. If any of these entities are inactive or don't exist, the system displays an error when you try to save the build step.

    This verification is not available if you use a password parameter to connect to Deployment Automation.

  5. (Optional) Configure advanced options for the build step.
  6. Click Save.

When finished, run the build. To review the report on each process, open the Build Log on the Build Results page.

After the build is complete, verify that the artifacts were transferred from TeamCity and deployed to the target environment. In Deployment Automation, navigate to Management > Applications, select your application, and review the deployment summary.

Back to top

Configure advanced options

When adding the Micro Focus Deploy build step, you can optionally specify its advanced settings.

To configure advanced options:

  1. Click Show advanced options at the bottom of the build step page. Additional fields are displayed.
  2. Add the following settings:

    Setting Description
    Execute Step

    Select the policy for running the build step:

    • Only if build status is successful. TeamCity runs the step only if the build status is successful.
    • If all previous steps finished successfully. TeamCity runs the step if the build step status returns no step failures.
    • Even if some of the previous steps failed. TeamCity runs the step regardless of the status of previous steps or the whole build.
    • Always, even if build stop command was issued. TeamCity always runs the step, even if you stop the build mid-run.
    Version Upload Settings
    Version Properties Specify properties for the component version. Enter each property on a new line using these formats:

    property01="property value"
    property02=%build.parameter%
    Add Files to Existing Version Select this option to upload files to an existing component version.

    If you leave this check box cleared, and the version you specified in the Version Name field already exists, the build fails.
    Create Empty Version Select this option to create an empty version without uploading the artifacts, for example, when you want to pull the artifacts from another source.
    Version Status Settings
    Add Status to Version Select this option to add a status to the version.

    To apply a version status in TeamCity, first create it in Deployment Automation. For details, see Define and use statuses.
    Version Status Name Enter the name of the status as defined in Deployment Automation.
    Version Deployment Settings
    Deploy Version if Enter a parameter that sets special conditions for deploying the artifacts, overriding the Deploy Version setting.

    For details on how to configure build parameters, see the TeamCity documentation.
    Deploy Properties Specify properties for the application process. Enter each property on a new line using these formats:

    property01="property value"
    property02=%build.parameter%
    Log REST Calls Select this option if you want all the REST API calls to Deployment Automation to be included in the TeamCity log.

Back to top

See also: