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
- Go to the Administration > Projects page.
- Select a project from the list or create a new one.
- On the Project Settings page, go to the Build Configurations section and click Create build configuration.
- Enter the name and id for the build configuration and optionally, a description.
- Click Create.
- Create or edit the VCS roots and the settings.
- On the Build Steps page, click the Add build step button.
- Select Add Artifact in CDA from the Runner type dropdown list.
- Scroll down and click Show advanced options. Go back to the top of the page.
- 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.
- Enter a name for the step.
Example: Add Artifact in CDA.
- Enter the URL to the CDA server.
Example: http://localhost/cda
Note: Variable parameters can be also used. For example: %teamcity.parameter%
-
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%
-
Enter the password for CDA.
Note: Variable parameters can be also used. For example: %teamcity.parameter%
-
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%
-
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%
-
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%
- Select one archive type from the dropdown list.
-
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.