Skip to content

abapEnvironmentRunATCCheck

Description

This step is for triggering an ATC test run on an SAP Cloud Platform ABAP Environment system. Please provide either of the following options:

  • The host and credentials the Cloud Platform ABAP Environment system itself. The credentials must be configured for the Communication Scenario SAP_COM_0510.
  • The Cloud Foundry parameters (API endpoint, organization, space), credentials, the service instance for the ABAP service and the service key for the Communication Scenario SAP_COM_0510.
  • Only provide one of those options with the respective credentials. If all values are provided, the direct communication (via host) has priority.

Regardless of the option you chose, please make sure to provide the configuration for Software Components and Packages that you want to be checked analog to the examples listed on this page.

Prerequisites

  • A SAP Cloud Platform ABAP Environment system is available. On this system, a Communication User, a Communication System and a Communication Arrangement is setup for the Communication Scenario “SAP Cloud Platform ABAP Environment - Software Component Test Integration (SAP_COM_0510)“. This can be done manually through the respective applications on the SAP Cloud Platform ABAP Environment System or through creating a service key for the system on cloud foundry with the parameters {“scenario_id”: “SAP_COM_0510", “type”: “basic”}. In a pipeline, you can do this with the step cloudFoundryCreateServiceKey.
  • You can either provide the ABAP endpoint configuration to directly trigger ann ATC run on the ABAP system or optionally provide the Cloud Foundry parameters with your credentials to read a Service Key of a SAP Cloud Platform ABAP Environment system in Cloud Foundry that contains all the details of the ABAP endpoint to trigger an ATC run.
  • Regardless if you chose an ABAP endpoint directly or reading a Cloud Foundry Service Key you have to provide the configuration of the packages and software components you want to be checked in an ATC run in a .yml or .yaml file. This file must be stored in the same folder as the Jenkinsfile defining the pipeline.
  • The Software Components and/or Packages you want to be checked must be present in the configured system in order to run the check. Please make sure that you have created or pulled the respective Software Components and/or Packages in the SAP Cloud Platform ABAP Environment system.

Examples will be listed below.

Parameters

name mandatory default possible values
abapCredentialsId Yes
atcConfig Yes
cfApiEndpoint No
cfOrg No
cfServiceInstance No
cfServiceKeyName No
cfSpace No
dockerEnvVars No []
dockerImage No ppiper/cf-cli
dockerName No cf
dockerOptions No []
dockerPullImage No false
dockerWorkspace No /home/piper
host No
password Yes
script Yes
username Yes
verbose No false true, false
  • abapCredentialsId: Jenkins credentials ID containing user and password to authenticate to the Cloud Platform ABAP Environment system or the Cloud Foundry API
  • atcConfig: Path to a YAML configuration file for Packages and/or Software Components to be checked during ATC run
  • cfApiEndpoint: Cloud Foundry API endpoint
  • cfOrg: CF org
  • cfServiceInstance: Parameter of ServiceInstance Name to delete CloudFoundry Service
  • cfServiceKeyName: Parameter of CloudFoundry Service Key to be created
  • cfSpace: CF Space
  • dockerEnvVars: Environment variables to set in the container, e.g. [http_proxy: "proxy:8080"].
  • dockerImage: Name of the docker image that should be used. If empty, Docker is not used and the command is executed directly on the Jenkins system.
  • dockerName: Kubernetes only: Name of the container launching dockerImage. SideCar only: Name of the container in local network.
  • dockerOptions: Docker options to be set when starting the container.
  • dockerPullImage: Set this to 'false' to bypass a docker image pull. Usefull during development process. Allows testing of images which are available in the local registry only.
  • dockerWorkspace: Kubernetes only: Specifies a dedicated user home directory for the container which will be passed as value for environment variable HOME.
  • host: Specifies the host address of the SAP Cloud Platform ABAP Environment system
  • password: User Password for CF User
  • script: The common script environment of the Jenkinsfile running. Typically the reference to the script calling the pipeline step is provided with the this parameter, as in script: this. This allows the function to access the commonPipelineEnvironment for retrieving, e.g. configuration parameters.
  • username: User or E-Mail for CF
  • verbose: verbose output

Step Configuration

We recommend to define values of step parameters via config.yml file.

In following sections of the config.yml the configuration is possible:

parameter general step/stage
atcConfig X
cfApiEndpoint X X
cfOrg X X
cfServiceInstance X X
cfServiceKeyName X X
cfSpace X X
dockerEnvVars X
dockerImage X
dockerName X
dockerOptions X
dockerPullImage X
dockerWorkspace X
host X
password X
username X
verbose X

Examples

Configuration in the config.yml

The recommended way to configure your pipeline is via the config.yml file. In this case, calling the step in the Jenkinsfile is reduced to one line:

abapEnvironmentRunATCCheck script: this

If you want to provide the host and credentials of the Communication Arrangement directly, the configuration could look as follows:

steps:
  abapEnvironmentRunATCCheck:
    abapCredentialsId: 'abapCredentialsId',
    host: 'https://myABAPendpoint.com',
    atcConfig: 'atcconfig.yml',

ATC run via Cloud Foundry Service Key example in Jenkinsfile

The following example triggers an ATC run via reading the Service Key of an ABAP instance in Cloud Foundry.

You can store the credentials in Jenkins and use the cfCredentialsId parameter to authenticate to Cloud Foundry. The username and password to authenticate to ABAP system will then be read from the Cloud Foundry Service Key that is bound to the ABAP instance.

This can be done accordingly:

abapEnvironmentRunATCCheck(
    cfApiEndpoint : 'https://test.server.com',
    cfOrg : 'cfOrg',
    cfSpace: 'cfSpace',
    cfServiceInstance: 'myServiceInstance',
    cfSserviceKeyName: 'myServiceKey',
    abapCredentialsId: 'cfCredentialsId',
    atcConfig: 'atcconfig.yml',
    script: this,
)

To trigger the ATC run an ATC config file atcconfig.yml will be needed. Check section 'ATC config file example' for more information.

ATC run via direct ABAP endpoint configuration in Jenkinsfile

This example triggers an ATC run directly on the ABAP endpoint.

In order to trigger the ATC run you have to pass the username and password for authentication to the ABAP endpoint via parameters as well as the ABAP endpoint/host. You can store the credentials in Jenkins and use the abapCredentialsId parameter to authenticate to the ABAP endpoint/host.

This must be configured as following:

abapEnvironmentRunATCCheck(
    abapCredentialsId: 'abapCredentialsId',
    host: 'https://myABAPendpoint.com',
    atcConfig: 'atcconfig.yml',
    script: this,
)

To trigger the ATC run an ATC config file atcconfig.yml will be needed. Check section 'ATC config file example' for more information.

ATC config file example

The following section contains an example of an atcconfig.yml file. This file must be stored in the same Git folder where the Jenkinsfile is stored to run the pipeline. This folder must be taken as a SCM in the Jenkins pipeline to run the pipeline.

You can specify a list of packages and/or software components to be checked. This must be in the same format as below example for a atcconfig.yml file. For each package that has to be checked you can configure if you want the subpackages to be included in checks or not. Please note that if you chose to provide both packages and software components to be checked with the atcconfig.yml file, the set of packages and the set of software components will be combinend by the API using a logical AND operation. Therefore, we advise to specify either the Software Components or Packages.

See below example for an atcconfig.yml file with both packages and software components to be checked:

atcobjects:
  package:
    - name: "TestPackage"
      includesubpackage: false
    - name: "TestPackage2"
      includesubpackage: true
  softwarecomponent:
    - name: "TestComponent"
    - name: "TestComponent2"

The following example of an atcconfig.yml file that only contains packages to be checked:

atcobjects:
  package:
    - name: "TestPackage"
      includesubpackage: false
    - name: "TestPackage2"
      includesubpackage: true

The following example of an atcconfig.yml file that only contains software components to be checked:

atcobjects:
  softwarecomponent:
    - name: "TestComponent"
    - name: "TestComponent2"