Adding an Artifact in CDA from TeamCity

You can configure a build step in TeamCity to create an Artifact and add it to a CDA instance.

Artifacts are single versions of Application Component deployments, which are located in a certain repository. Artifacts reference real files in the repository, which contain the Component version. Examples of Artifacts are: MyApp_05.02.2018.jar, DB-??.sql, /db/v3/scripts/*.sql, MyRepo LATEST. For more information, see: Working with Artifacts

To Add an Artifact 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 Add Artifact in CDA 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: Add Artifact 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. Enter the name of the Artifact Source where the Artifact will be stored. For more information, see: Working with Artifact Sources

    Example: Central_Repo

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

  16. Enter the name of the Artifact to be created.

    Note: Variables can be used. A variable name must start with the % character.

    Example: %build.number%

  17. Enter the Artifact properties key value pairs in JSON format.

    Example:{ "source_path":"/ftp/mysample.war", "checksum_path": "bf35fa420d3e0f669e27b337062bf19f510480d4" }

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

  18. Select one archive type from the dropdown list.
  19. Enter the name of the Application Components to which the Artifact should be added as follows: ApplicationName:ComponentName.

    Example: SampleApp:ComponentA, MyApp:ComponentB.

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

Post-Build Step Behavior

Note the following:

  • If the build fails, the Artifact will not be created.
  • If the Artifact creation fails, the build will fail too.