Creating a Package in CDA from TeamCity

A Deployment Package in CDA is an instance of an Application that defines the content that will be deployed (either the entire Application or only a few Components).

To Create a Package from TeamCity

  1. Go to the Administration > Projects page.
  2. Select a project from the list or create a new one.
  3. On the Project Settings page, go to the Build Configurations section and click Create build configuration.
  4. Enter the name and id for the build configuration and optionally, a description.
  5. Click Create.
  6. Create or edit the VCS roots and the settings.
  7. On the Build Steps page, click the Add build step button.
  8. Select CDA Package from the Runner type dropdown list.
  9. Scroll down and click Show advanced options. Go back to the top of the page.
  10. Select one of the conditions for executing the step. The option to execute the step only if all previous steps finished successfully is selected by default.
  11. Enter a name for the step.

    Example: Create Package in CDA

  12. Enter the URL to the CDA server.

    Example: http://localhost/cda

    Note: Variable parameters can be also used. For example: %teamcity.parameter%

  13. Enter the user credentials in CDA in the format: CLIENT/USER/DEPARTMENT.

    Example: 100/JOE/ADMIN

    Notes:

    • Uppercase is required.
    • Variable parameters can be also used. For example: %teamcity.parameter%
  14. Enter the password for CDA.

    Note: Variable parameters can be also used. For example: %teamcity.parameter%

  15. Do not fail if the package already exists: If set to true, the existing Package will be updated. It will also allow to update/add properties and dynamic properties to the existing package.

    • Only new Components can be added to an existing Package.
    • The Components already added to an existing Package will not be modified.
  16. Auto assign artifacts: If set to true, the latest artifact will be automatically assigned to the Components which are not assigned any artifact. This option is used while creating a new Package.
  17. Package Name: name of the Package to be created in Automic Continuous Delivery Automation.

    Notes:

    • Variable parameters can be also used. For example: %teamcity.parameter%
    • Archived Packages are not supported.
  18. Package Type: Deployment (more types may be added by the CDA administrator).

    Note: Variable parameters can be also used. For example: %teamcity.parameter%

  19. Application: Application name. The application must exist in CDA.

    Notes:

    • Variable parameters can be also used. For example: %teamcity.parameter%
    • Archived applications are not supported.

  20. Folder: folder in which the Package should be created.

    Notes:

    • Folders are used to manage user rights
    • Variable parameters can be also used. For example: %teamcity.parameter%
  21. (Optional) Enter the Package owner in the format: CLIENT/USER/DEPARTMENT.

    Notes:

    • Owners are used for filtering entities and managing user rights, as they are stored in folders.
    • Variable parameters can be also used. For example: %teamcity.parameter%
  22. (Optional) Click Add Component to assign a Component to the Package.

    Notes:

    • If no Components are assigned, all Components of the Application will be added.
    • Variable parameters can be also used. For example: %teamcity.parameter%
    • Archived Components are not supported.
  23. (Optional) Click Add Artifact to provide the name of the Artifact Source and Artifact that should be included in the Deployment Package. For more information, see Working with Artifacts. Also, you can provide custom fields in JSON key value pairs. For example: {"source_path":"/ftp/mysample.war"}.
  24. (Optional) In the Properties section, you can overwrite the custom properties of the Package. To do so, enter the type, name, and value of the properties you want to overwrite. You can set the property type as Link or Others.

    Note: the Link property type must be in the following format: <URL> <Title>. For example: http://localhost/cda CDA URL

  25. (Optional) In the Dynamic Properties section, you can overwrite the dynamic properties of the Package.

    Notes:

    • The property name must be in fully qualified name format (for example: /db/user or /user)
    • Variable parameters can be also used. For example: %teamcity.parameter%

Post-Build Step Behavior

Note the following:

  • If the build fails, the CDA packages are not created at all
  • If the package creation failed for some reason, the build fails too