Skip to content

abapEnvironmentPushATCSystemConfig

Create/Update ATC System Configuration

Description

This step is for creating/updating an ATC system configurationon on an SAP BTP, ABAP Environment system. Please provide either of the following options:

  • The host and credentials the SAP BTP, ABAP Environment system itself. The credentials must be configured for the Communication Scenario SAP_COM_0763.
  • 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_0763.
  • Only provide one of those options with the respective credentials. If all values are provided, the direct communication (via host) has priority.

Usage

We recommend to define values of step parameters via .pipeline/config.yml file.
In this case, calling the step is essentially reduced to defining the step name.
Calling the step can be done either in an orchestrator specific way (e.g. via a Jenkins library step) or on the command line.

library('piper-lib-os')

abapEnvironmentPushATCSystemConfig script: this
piper abapEnvironmentPushATCSystemConfig

Prerequisites

  • A SAP BTP, ABAP environment system is available. On this system, a Communication User, a Communication System and a Communication Arrangement is setup for the Communication Scenario “ABAP Test Cockpit Configuration Integration (SAP_COM_0763)“. This can be done manually through the respective applications on the SAP BTP, ABAP environment system or through creating a service key for the system on Cloud Foundry with the parameters {“scenario_id”: “SAP_COM_0763", “type”: “basic”}. In a pipeline, you can do this with the step cloudFoundryCreateServiceKey.
  • You can either provide the ABAP endpoint configuration to directly trigger an ATC run on the ABAP system or optionally provide the Cloud Foundry parameters with your credentials to read a Service Key of a SAP BTP, 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 BTP, ABAP environment system.

Examples will be listed below.

Parameters

Overview - Step

Name Mandatory Additional information
atcSystemConfigFilePath yes
password (yes) Secret pass via ENV or Jenkins credentials (abapCredentialsId)
script (yes) Jenkins only reference to Jenkins main pipeline script
username (yes) Secret pass via ENV or Jenkins credentials (abapCredentialsId)
cfApiEndpoint no
cfOrg no
cfServiceInstance no
cfServiceKeyName no
cfSpace no
host no
patchIfExisting no
verbose no activates debug output

Overview - Execution Environment

Orchestrator-specific only

These parameters are relevant for orchestrator usage and not considered when using the command line option.

Name Mandatory Additional information
containerCommand no Jenkins only
containerShell no Jenkins only
dockerEnvVars no
dockerImage no
dockerName no
dockerOptions no
dockerPullImage no
dockerVolumeBind no Jenkins only
dockerWorkspace no Jenkins only

Details

atcSystemConfigFilePath

Path to a JSON file with ATC System Configuration

back to overview

Scope Details
Aliases -
Type string
Mandatory yes
Default $PIPER_atcSystemConfigFilePath (if set)
Secret no
Configuration scope
  • ☒ parameter
  • ☐ general
  • ☒ steps
  • ☒ stages
Resource references none

cfApiEndpoint

Cloud Foundry API endpoint

back to overview

Scope Details
Aliases cloudFoundry/apiEndpoint
Type string
Mandatory no
Default $PIPER_cfApiEndpoint (if set)
Secret no
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
Resource references none

cfOrg

CF org

back to overview

Scope Details
Aliases cloudFoundry/org
Type string
Mandatory no
Default $PIPER_cfOrg (if set)
Secret no
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
Resource references none

cfServiceInstance

Parameter of ServiceInstance Name to delete CloudFoundry Service

back to overview

Scope Details
Aliases cloudFoundry/serviceInstance
Type string
Mandatory no
Default $PIPER_cfServiceInstance (if set)
Secret no
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
Resource references none

cfServiceKeyName

Parameter of CloudFoundry Service Key to be created

back to overview

Scope Details
Aliases - cloudFoundry/serviceKey
- cloudFoundry/serviceKeyName
- cfServiceKey
Type string
Mandatory no
Default $PIPER_cfServiceKeyName (if set)
Secret no
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
Resource references none

cfSpace

CF Space

back to overview

Scope Details
Aliases cloudFoundry/space
Type string
Mandatory no
Default $PIPER_cfSpace (if set)
Secret no
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
Resource references none

containerCommand

Jenkins-specific: Used for proper environment setup.

Kubernetes only: Allows to specify start command for container created with dockerImage parameter to overwrite Piper default (/usr/bin/tail -f /dev/null).

back to overview

Scope Details
Aliases -
Type string
Mandatory no
Default
Secret no
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
Resource references none

containerShell

Jenkins-specific: Used for proper environment setup.

Allows to specify the shell to be executed for container with containerName.

back to overview

Scope Details
Aliases -
Type string
Mandatory no
Default
Secret no
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
Resource references none

dockerEnvVars

Jenkins-specific: Used for proper environment setup.

Environment variables to set in the container, e.g. [http_proxy: "proxy:8080"].

back to overview

Scope Details
Aliases -
Type map[string]string
Mandatory no
Default
Secret no
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
Resource references none

dockerImage

Jenkins-specific: Used for proper environment setup.

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.

back to overview

Scope Details
Aliases -
Type string
Mandatory no
Default ppiper/cf-cli:v12
Secret no
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
Resource references none

dockerName

Jenkins-specific: Used for proper environment setup.

Kubernetes only: Name of the container launching dockerImage. SideCar only: Name of the container in local network.

back to overview

Scope Details
Aliases -
Type string
Mandatory no
Default cf
Secret no
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
Resource references none

dockerOptions

Jenkins-specific: Used for proper environment setup.

Docker options to be set when starting the container.

back to overview

Scope Details
Aliases -
Type []string
Mandatory no
Default
Secret no
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
Resource references none

dockerPullImage

Jenkins-specific: Used for proper environment setup.

Set this to 'false' to bypass a docker image pull. Useful during development process. Allows testing of images which are available in the local registry only.

back to overview

Scope Details
Aliases -
Type bool
Mandatory no
Default true
Possible values - true
- false
Secret no
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
Resource references none

dockerVolumeBind

Jenkins-specific: Used for proper environment setup.

Volumes that should be mounted into the docker container.

back to overview

Scope Details
Aliases -
Type map[string]string
Mandatory no
Default
Secret no
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
Resource references none

dockerWorkspace

Jenkins-specific: Used for proper environment setup.

Kubernetes only: Specifies a dedicated user home directory for the container which will be passed as value for environment variable HOME.

back to overview

Scope Details
Aliases -
Type string
Mandatory no
Default
Secret no
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
Resource references none

host

Specifies the host address of the SAP SAP BTP, ABAP Environment system

back to overview

Scope Details
Aliases -
Type string
Mandatory no
Default $PIPER_host (if set)
Secret no
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
Resource references none

password

Password for either the Cloud Foundry API or the Communication Arrangement for SAP_COM_0763

back to overview

Scope Details
Aliases -
Type string
Mandatory yes
Default $PIPER_password (if set)
Secret yes
Configuration scope
  • ☒ parameter
  • ☐ general
  • ☒ steps
  • ☒ stages
Resource references Jenkins credential id:
  id: abapCredentialsId
  reference to: password

patchIfExisting

In case an configuration under the given name already exists in the system. Should the step update/patch the existing ATC Systm Configuration from the provided ATC System Configuration file?

back to overview

Scope Details
Aliases -
Type bool
Mandatory no
Default true
Possible values - true
- false
Secret no
Configuration scope
  • ☒ parameter
  • ☐ general
  • ☒ steps
  • ☒ stages
Resource references none

script

Jenkins-specific: Used for proper environment setup.

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.

back to overview

Scope Details
Aliases -
Type Jenkins Script
Mandatory yes
Default
Secret no
Configuration scope
  • ☐ parameter
  • ☐ general
  • ☐ steps
  • ☐ stages
Resource references none

username

User for either the Cloud Foundry API or the Communication Arrangement for SAP_COM_0763

back to overview

Scope Details
Aliases -
Type string
Mandatory yes
Default $PIPER_username (if set)
Secret yes
Configuration scope
  • ☒ parameter
  • ☐ general
  • ☒ steps
  • ☒ stages
Resource references Jenkins credential id:
  id: abapCredentialsId
  reference to: username

verbose

verbose output

back to overview

Scope Details
Aliases -
Type bool
Mandatory no
Default false
Possible values - true
- false
Secret no
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
Resource references none

abapCredentialsId

Jenkins-specific: Used for proper environment setup. See using credentials for details.

Jenkins credentials ID containing user and password to authenticate to the SAP BTP, ABAP Environment system or the Cloud Foundry API

back to overview

Scope Details
Aliases cfCredentialsId
Type string
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages

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:

abapEnvironmentPushATCSystemConfig script: this

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

steps:
  abapEnvironmentPushATCSystemConfig:
    abapCredentialsId: 'abapCredentialsId',
    host: 'https://myABAPendpoint.com',
    atcSystemConfigFilePath: 'atcSystemConfig.json',

To trigger a create/update ATC System Configuration step an ATC System configuration file atcSystemConfig.json will be needed. Check section 'ATC System Configuration file example' for more information.

Create/Update an ATC System Configuration via Cloud Foundry Service Key example in Jenkinsfile

The following example triggers a Create/Update operation on an ATC System Configuration 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:

abapEnvironmentPushATCSystemConfig(
    cfApiEndpoint : 'https://test.server.com',
    cfOrg : 'cfOrg',
    cfSpace: 'cfSpace',
    cfServiceInstance: 'myServiceInstance',
    cfServiceKeyName: 'myServiceKey',
    abapCredentialsId: 'cfCredentialsId',
    atcSystemConfigFilePath: 'atcSystemConfig.json',
    script: this,
)

Create/Update an ATC System Configuration via direct ABAP endpoint configuration in Jenkinsfile

This example triggers a create/update operation on an ATC System Configuration run directly on the ABAP endpoint.

In order to trigger the create/update operation on an ATC System Configuration 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:

abapEnvironmentPushATCSystemConfig(
    abapCredentialsId: 'abapCredentialsId',
    host: 'https://myABAPendpoint.com',
    atcSystemConfigFilePath: 'atcSystemConfig.json',
    script: this,
)

To create/update an ATC System Configuration a file atcSystemConfig.json will be needed. Check section 'ATC System configuration file example' for more information.

ATC System configuration file example

The step always performs a check first, if an ATC System Configuration with the same name provided in the file atcSystemConfig.json with the attribute conf_name. This file contains an JSON Representation of an ATC System Configuration. Some json file examples can be found below.

In case an ATC System Configuration with this name already exists, by default, the step would perform an update of this ATC System Configuration with the ATC System Configuration information provided in file atcSystemConfig.json. If this is not desired, an update could be supressed by using the parameter patchIfExisting in the configuration yaml the following way:

steps:
  abapEnvironmentPushATCSystemConfig:
    atcSystemConfigFilePath: atcSystemConfig.json,
    patchIfExisting: false,

In this case the step skips further processing after existence check and returns with a Warning.

Providing a specifc System configuration file atcSystemConfig.json is mandatory.

The following section contains an example of an atcSystemConfig.json 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.

See below an example for an atcSystemConfig.json file for creating/updating an ATC System Configuration with the name myATCSystemConfigurationName including a change of one priority.

{
  "conf_name": "myATCSystemConfigurationName",
  "checkvariant": "SAP_CLOUD_PLATFORM_ATC_DEFAULT",
  "block_findings": "0",
  "inform_findings": "1",
  "_priorities": [
    {
      "test": "CL_CI_TEST_AMDP_HDB_MIGRATION",
      "message_id": "FAIL_ABAP",
      "priority": 2
    }
  ]
}

See below an example for an atcSystemConfig.json file for creating/updating an ATC System Configuration with the name myATCSystemConfigurationName.

{
  "conf_name": "myATCSystemConfigurationName",
  "checkvariant": "SAP_CLOUD_PLATFORM_ATC_DEFAULT",
  "block_findings": "0",
  "inform_findings": "1"
}