Creating a Package from a Pipeline in Jenkins

  1. Go to the main page and create a pipeline (New Item > Pipeline) or use an existing one.
  2. Open the Pipeline Syntax.
  3. In the sample step field, select the createDepPckg: CDA Create Package step from the drop-down list.
  4. Do one of the following:
    • Select the Use Centralized CDA Connection Parameters checkbox to authenticate with the centralized connection details . See: Configuring CDA Centralized Connection Details).
    • Enter the connection details:
      • Server

        Example:

        http://192.000.000.00/cda

      • Full Username

        Examples:

        • 1000/USER/DEP
        • AUTOMIC/1000/USER/DEP
      • Password

  5. Click Test connection to ensure that the connection succeeds.
  6. Once the connection has been checked, fill in the other fields as follows:
      1. 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.
      2. 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.
      3. Package Name: name of the Package to be created in Automic Continuous Delivery Automation.

        Notes:

        • This value can also contain variables (for example: Build environment variable). Variables must start with $.
        • Archived Packages are not supported.
      4. Package Type: Deployment (more types may be added by the CDA administrator).

        Note: This value can also contain variables. Variables must start with $.

      5. Application: Application name.

        Notes:

        • This value can also contain variables. Variables must start with $.
        • Archived applications are not supported.

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

        Notes:

        • Folders are used to manage user rights.
        • This value can also contain variables. Variables must start with $.
      7. Owner: Owner name.

        Notes:

        • Owners are used for filtering entities and managing user rights, as they are stored in folders.
        • This value can also contain variables. Variables must start with $.
      8. Components: by default, all Components of the Application are assigned to the Package. If you click Add Component, only the selected Components will be assigned.
        1. (Optional) you can specify one or more conditions for each Component, so that only the ones which comply with the conditions are added to the Package. To do so:
          1. Click Add condition.
          2. Select the condition operation from the drop-down list and provide a value.

          Notes:

          • Values are case insensitive and can contain regular expressions and variables. Variables must start with $. If the value is not specified, the corresponding condition is skipped.
          • A Component is added into a Package only if all conditions are met
          • Archived Components are not supported.
        2. (Optional) You can also add an artifact to the package. To do so:

          1. Enter the name of the Component.
          2. Enter the name of the artifact source from which the artifact should be retrieved.
          3. Enter the name of the artifact to be included in the package.
          4. Enter the name of the artifact folder in the Folder field.

          5. You can provide more custom fields in valid JSON key value pairs. For example:

            {

            "source_path":"/ftp/mysample.war",

            "checksum_path": "bf35fa420d3e0f669e27b337062bf19f510480d4"

            }

          Notes:

          • Changes made to custom fields of an already existing artifact are ignored.
          • If you enter an artifact name which does not exist in the system, a new artifact is generated while creating the package.
          • The name of the artifact folder in which artifact to be created. If not provided, artifact folder of the specified artifact source will be used.

          • For more information see: Working with Artifacts, Working with Artifact Sources

        3. Properties: click Set Property if you want to overwrite the custom properties of the Package.

          Note: You can set the property type as a Link or as Others. The link property type must have the following format: "{PropertyName}": "{Link} {Title}"

          Example:

          • In the Type Of Property field, select “Link”
          • In the Property Name field, enter “chart_location”
          • In the Property Value field, enter “http://test.com text”
        4. If it does not already exist, enter the name of the artifact folder in which the artifact should be created.

        5. Dynamic Properties: click Add Dynamic Property if you want to overwrite the dynamic properties of the Package.

          Note: Custom and dynamic property values can also contain variables (for example: Build environment variable). Variables must start with $.

  7. Click Generate Pipeline Script. A string containing the Package definition is generated.
  8. Copy the generated content.
  9. Click Back at the top left and select Configuration.
  10. Select the Pipeline tab and paste the copied content to the Script field.
  11. Save your changes.