metadata:
  name: abapAddonAssemblyKitRegisterPackages
  description: This step uploads the SAR archives and creates physical Delivery Packages to AAKaaS.
  longDescription: |
    This step takes the list of Software Component Versions from the addonDescriptor in the commonPipelineEnvironment.
    For Packages in status "P" = planned it uploads the SAR archive with the data file and metadata XML of the Delivery Packages composed and exported in the build system
    and creates physical Delivery Package in AAKaaS.
    The new status "L" = locked is written back to the addonDescriptor in the commonPipelineEnvironment.
    <br />
    For Terminology refer to the [Scenario Description](https://www.project-piper.io/scenarios/abapEnvironmentAddons/).

spec:
  inputs:
    secrets:
      - name: abapAddonAssemblyKitCredentialsId
        description: Credential stored in Jenkins for the Addon Assembly Kit as a Service (AAKaaS) system
        type: jenkins
    params:
      - name: abapAddonAssemblyKitEndpoint
        type: string
        description: Base URL to the Addon Assembly Kit as a Service (AAKaaS) system
        scope:
          - PARAMETERS
          - STAGES
          - STEPS
          - GENERAL
        mandatory: true
        default: https://apps.support.sap.com
      - name: username
        type: string
        description: User for the Addon Assembly Kit as a Service (AAKaaS) system
        scope:
          - PARAMETERS
          - STAGES
          - STEPS
        mandatory: true
        secret: true
      - name: password
        type: string
        description: Password for the Addon Assembly Kit as a Service (AAKaaS) system
        scope:
          - PARAMETERS
        mandatory: true
        secret: true
      - name: addonDescriptor
        type: string
        description: Structure in the commonPipelineEnvironment containing information about the Product Version and corresponding Software Component Versions
        mandatory: true
        scope:
          - PARAMETERS
          - STAGES
          - STEPS
        resourceRef:
          - name: commonPipelineEnvironment
            param: abap/addonDescriptor
  outputs:
    resources:
      - name: commonPipelineEnvironment
        type: piperEnvironment
        params:
          - name: abap/addonDescriptor
