github.com/jaylevin/jenkins-library@v1.230.4/documentation/docs/steps/abapEnvironmentRunATCCheck.md (about) 1 # ${docGenStepName} 2 3 ## ${docGenDescription} 4 5 !!! Currently the Object Set configuration is limited to the usage of Multi Property Sets. Please note that other sets besides the Multi Property Set will not be included in the ATC runs. You can see an example of the Multi Property Sets with all configurable properties. However, we strongly reccommend to only specify packages and software components like in the first two examples of the section `ATC config file example`. 6 7 ## Prerequisites 8 9 * A SAP BTP, ABAP environment system is available. On this system, a [Communication User](https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/0377adea0401467f939827242c1f4014.html), a [Communication System](https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/1bfe32ae08074b7186e375ab425fb114.html) and a [Communication Arrangement](https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/a0771f6765f54e1c8193ad8582a32edb.html) is setup for the Communication Scenario “SAP BTP, ABAP Environment - Software Component Test Integration (SAP_COM_0510)“. 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_0510", “type”: “basic”}. In a pipeline, you can do this with the step [cloudFoundryCreateServiceKey](https://sap.github.io/jenkins-library/steps/cloudFoundryCreateServiceKey/). 10 * 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. 11 * 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. 12 * 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. 13 14 Examples will be listed below. 15 16 ## ${docGenParameters} 17 18 ## ${docGenConfiguration} 19 20 ## ${docJenkinsPluginDependencies} 21 22 ## Examples 23 24 ### Configuration in the config.yml 25 26 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: 27 28 ```groovy 29 abapEnvironmentRunATCCheck script: this 30 ``` 31 32 If you want to provide the host and credentials of the Communication Arrangement directly, the configuration could look as follows: 33 34 ```yaml 35 steps: 36 abapEnvironmentRunATCCheck: 37 abapCredentialsId: 'abapCredentialsId', 38 host: 'https://myABAPendpoint.com', 39 atcConfig: 'atcconfig.yml', 40 ``` 41 42 ### ATC run via Cloud Foundry Service Key example in Jenkinsfile 43 44 The following example triggers an ATC run via reading the Service Key of an ABAP instance in Cloud Foundry. 45 46 You can store the credentials in Jenkins and use the cfCredentialsId parameter to authenticate to Cloud Foundry. 47 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. 48 49 This can be done accordingly: 50 51 ```groovy 52 abapEnvironmentRunATCCheck( 53 cfApiEndpoint : 'https://test.server.com', 54 cfOrg : 'cfOrg', 55 cfSpace: 'cfSpace', 56 cfServiceInstance: 'myServiceInstance', 57 cfServiceKeyName: 'myServiceKey', 58 abapCredentialsId: 'cfCredentialsId', 59 atcConfig: 'atcconfig.yml', 60 script: this, 61 ) 62 ``` 63 64 To trigger the ATC run an ATC config file `atcconfig.yml` will be needed. Check section 'ATC config file example' for more information. 65 66 ### ATC run via direct ABAP endpoint configuration in Jenkinsfile 67 68 This example triggers an ATC run directly on the ABAP endpoint. 69 70 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. 71 72 This must be configured as following: 73 74 ```groovy 75 abapEnvironmentRunATCCheck( 76 abapCredentialsId: 'abapCredentialsId', 77 host: 'https://myABAPendpoint.com', 78 atcConfig: 'atcconfig.yml', 79 script: this, 80 ) 81 ``` 82 83 To trigger the ATC run an ATC config file `atcconfig.yml` will be needed. Check section 'ATC config file example' for more information. 84 85 ### ATC config file example 86 87 Providing a specifc ATC configuration is optional. If you are using a `repositories.yml` file for the `Clone` stage of the ABAP environment pipeline, a default ATC configuration will be derived if no explicit ATC configuration is available. 88 89 The following section contains an example of an `atcconfig.yml` file. 90 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. 91 92 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. 93 In case subpackages shall be included in the checks you can use packagetrees. 94 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. 95 Therefore, we advise to specify either the software components or packages. 96 Additionally, if you don't specify a dedicated ATC check variant to be used, the `ABAP_CLOUD_DEVELOPMENT_DEFAULT` variant will be used as default. For more information on how to configure a check variant for an ATC run please check the last example on this page. 97 98 See below example for an `atcconfig.yml` file with both packages and software components to be checked: 99 100 ```yaml 101 objectset: 102 softwarecomponents: 103 - name: TestComponent 104 - name: TestComponent2 105 packages: 106 - name: TestPackage 107 packagetrees: 108 - name: TestPackageWithSubpackages 109 ``` 110 111 The following example of an `atcconfig.yml` file that only contains packages and packagetrees to be checked: 112 113 ```yaml 114 objectset: 115 packages: 116 - name: TestPackage 117 packagetrees: 118 - name: TestPackageWithSubpackages 119 ``` 120 121 The following example of an `atcconfig.yml` file that only contains software components to be checked: 122 123 ```yaml 124 objectset: 125 softwarecomponents: 126 - name: TestComponent 127 - name: TestComponent2 128 ``` 129 130 The following is an example of an `atcconfig.yml` file that supports the check variant and configuration ATC options and containing the software components `TestComponent` and `TestComponent2` as Objectset. 131 132 ```yaml 133 checkvariant: "TestCheckVariant" 134 configuration: "TestConfiguration" 135 objectset: 136 softwarecomponents: 137 - name: TestComponent 138 - name: TestComponent2 139 ``` 140 141 The following example of an `atcconfig.yml` file contains all possible properties of the Multi Property Set that can be used. Please take note that this is not the reccommended approach. If you want to check packages or software components please use the two above examples. The usage of the Multi Property Set is only reccommended for ATC runs that require these rules for the test execution. There is no official documentation on the usage of the Multi Property Set. 142 143 ```yaml 144 checkvariant: "TestCheckVariant" 145 configuration: "TestConfiguration" 146 objectset: 147 type: multiPropertySet 148 multipropertyset: 149 owners: 150 - name: demoOwner 151 softwarecomponents: 152 - name: demoSoftwareComponent 153 versions: 154 - value: ACTIVE 155 packages: 156 - name: demoPackage 157 packagetrees: 158 - name: TestPackageWithSubpackages 159 objectnamepatterns: 160 - value: 'ZCL_*' 161 languages: 162 - value: EN 163 sourcesystems: 164 - name: H01 165 objecttypes: 166 - name: CLAS 167 objecttypegroups: 168 - name: CLAS 169 releasestates: 170 - value: RELEASED 171 applicationcomponents: 172 - name: demoApplicationComponent 173 transportlayers: 174 - name: H01 175 ```