abapEnvironmentBuild¶
Executes builds as defined with the build framework
Description¶
Executes builds as defined with the build framework. Transaction overview /n/BUILD/OVERVIEW
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')
abapEnvironmentBuild script: this
piper abapEnvironmentBuild
Outputs¶
Output type | Details |
---|---|
commonPipelineEnvironment |
|
Prerequisites SAP BTP, ABAP environment¶
- A SAP BTP, ABAP environment system is available.
- This can be created manually on Cloud Foundry.
- In a pipeline, you can do this, for example, with the step cloudFoundryCreateService.
- Communication Scenario “SAP BTP, ABAP Environment - Software Assembly Integration (SAP_COM_0582)“ is setup for this system.
- E.g. a Communication User, a Communication System and a Communication Arrangement are configured.
- 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_0582", “type”: “basic”}.
- In a pipeline, you can do this, for example, with the step cloudFoundryCreateServiceKey.
- You have following options to provide the ABAP endpoint configuration:
- The host and credentials the SAP BTP, ABAP environment system itself. The credentials must be configured for the Communication Scenario SAP_COM_0582.
- 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_0582.
- Only provide one of those options with the respective credentials. If all values are provided, the direct communication (via host) has priority.
Prerequisites On Premise¶
- You need to specify the host and credentials to your system
- A certificate for the system needs to be stored in .pipeline/trustStore and the name of the certificate needs to be handed over via the configuration
Parameters¶
Overview - Step¶
Name | Mandatory | Additional information |
---|---|---|
password | (yes) | pass via ENV or Jenkins credentials |
phase | yes | |
script | (yes) | reference to Jenkins main pipeline script |
username | (yes) | pass via ENV or Jenkins credentials |
abapSourceClient | no | |
addonDescriptor | no | |
certificateNames | no | |
cfApiEndpoint | no | |
cfOrg | no | |
cfServiceInstance | no | |
cfServiceKeyName | no | |
cfSpace | no | |
conditionOnAddonDescriptor | no | |
cpeValues | no | |
downloadAllResultFiles | no | |
downloadResultFilenames | no | |
filenamePrefixForDownload | no | |
host | no | |
maxRuntimeInMinutes | no | |
pollingIntervalInSeconds | no | |
publishAllDownloadedResultFiles | no | |
publishResultFilenames | no | |
stopOnFirstError | no | |
subDirectoryForDownload | no | |
treatWarningsAsError | no | |
useFieldsOfAddonDescriptor | no | |
values | 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 | |
containerShell | no | |
dockerEnvVars | no | |
dockerImage | no | |
dockerName | no | |
dockerOptions | no | |
dockerPullImage | no | |
dockerVolumeBind | no | |
dockerWorkspace | no |
Details¶
abapSourceClient¶
Specifies the client of the SAP BTP ABAP Environment system, use only in combination with host
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | $PIPER_abapSourceClient (if set) |
Secret | no |
Configuration scope |
|
Resource references | none |
addonDescriptor¶
Structure in the commonPipelineEnvironment containing information about the Product Version and corresponding Software Component Versions
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | $PIPER_addonDescriptor (if set) |
Secret | no |
Configuration scope |
|
Resource references | commonPipelineEnvironment: reference to: abap/addonDescriptor |
certificateNames¶
file names of trusted (self-signed) server certificates - need to be stored in .pipeline/trustStore
Scope | Details |
---|---|
Aliases | - |
Type | []string |
Mandatory | no |
Default | $PIPER_certificateNames (if set) |
Secret | no |
Configuration scope |
|
Resource references | none |
cfApiEndpoint¶
Cloud Foundry API endpoint
Scope | Details |
---|---|
Aliases | cloudFoundry/apiEndpoint |
Type | string |
Mandatory | no |
Default | $PIPER_cfApiEndpoint (if set) |
Secret | no |
Configuration scope |
|
Resource references | none |
cfOrg¶
Cloud Foundry target organization
Scope | Details |
---|---|
Aliases | cloudFoundry/org |
Type | string |
Mandatory | no |
Default | $PIPER_cfOrg (if set) |
Secret | no |
Configuration scope |
|
Resource references | none |
cfServiceInstance¶
Cloud Foundry Service Instance
Scope | Details |
---|---|
Aliases | cloudFoundry/serviceInstance |
Type | string |
Mandatory | no |
Default | $PIPER_cfServiceInstance (if set) |
Secret | no |
Configuration scope |
|
Resource references | none |
cfServiceKeyName¶
Cloud Foundry Service Key
Scope | Details |
---|---|
Aliases | - cloudFoundry/serviceKey - cloudFoundry/serviceKeyName - cfServiceKey |
Type | string |
Mandatory | no |
Default | $PIPER_cfServiceKeyName (if set) |
Secret | no |
Configuration scope |
|
Resource references | none |
cfSpace¶
Cloud Foundry target space
Scope | Details |
---|---|
Aliases | cloudFoundry/space |
Type | string |
Mandatory | no |
Default | $PIPER_cfSpace (if set) |
Secret | no |
Configuration scope |
|
Resource references | none |
conditionOnAddonDescriptor¶
normally if useFieldsOfAddonDescriptor is not initial, a build is triggered for each repository in the addonDescriptor. This can be changed by posing conditions. Please enter in the format '[{"field":"Status","operator":"==","value":"P"}]'
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | $PIPER_conditionOnAddonDescriptor (if set) |
Secret | no |
Configuration scope |
|
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).
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
containerShell¶
Jenkins-specific: Used for proper environment setup.
Allows to specify the shell to be executed for container with containerName.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
cpeValues¶
Values taken from the previous step, if a value was also specified in the config file, the value from cpe will be discarded
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | $PIPER_cpeValues (if set) |
Secret | no |
Configuration scope |
|
Resource references | commonPipelineEnvironment: reference to: abap/buildValues |
dockerEnvVars¶
Jenkins-specific: Used for proper environment setup.
Environment variables to set in the container, e.g. [http_proxy: "proxy:8080"].
Scope | Details |
---|---|
Aliases | - |
Type | map[string]string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
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.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | ppiper/cf-cli:v12 |
Secret | no |
Configuration scope |
|
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.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | cf |
Secret | no |
Configuration scope |
|
Resource references | none |
dockerOptions¶
Jenkins-specific: Used for proper environment setup.
Docker options to be set when starting the container.
Scope | Details |
---|---|
Aliases | - |
Type | []string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
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.
Scope | Details |
---|---|
Aliases | - |
Type | bool |
Mandatory | no |
Default | true |
Possible values | - true - false |
Secret | no |
Configuration scope |
|
Resource references | none |
dockerVolumeBind¶
Jenkins-specific: Used for proper environment setup.
Volumes that should be mounted into the docker container.
Scope | Details |
---|---|
Aliases | - |
Type | map[string]string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
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
.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
downloadAllResultFiles¶
If true, all build artefacts are downloaded
Scope | Details |
---|---|
Aliases | - |
Type | bool |
Mandatory | no |
Default | false |
Possible values | - true - false |
Secret | no |
Configuration scope |
|
Resource references | none |
downloadResultFilenames¶
Only the specified files are downloaded. If downloadAllResultFiles is true, this parameter is ignored
Scope | Details |
---|---|
Aliases | - |
Type | []string |
Mandatory | no |
Default | $PIPER_downloadResultFilenames (if set) |
Secret | no |
Configuration scope |
|
Resource references | none |
filenamePrefixForDownload¶
Filename prefix for the downloaded files, {buildID} and {taskID} can be used and will be resolved accordingly
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | $PIPER_filenamePrefixForDownload (if set) |
Secret | no |
Configuration scope |
|
Resource references | none |
host¶
Specifies the host address of the SAP BTP ABAP Environment system
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | $PIPER_host (if set) |
Secret | no |
Configuration scope |
|
Resource references | none |
maxRuntimeInMinutes¶
maximal runtime of the step in minutes
Scope | Details |
---|---|
Aliases | - |
Type | int |
Mandatory | no |
Default | 360 |
Secret | no |
Configuration scope |
|
Resource references | none |
password¶
Password
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | yes |
Default | $PIPER_password (if set) |
Secret | yes |
Configuration scope |
|
Resource references | none |
phase¶
Phase as specified in the build script in the backend system
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | yes |
Default | $PIPER_phase (if set) |
Secret | no |
Configuration scope |
|
Resource references | none |
pollingIntervalInSeconds¶
wait time in seconds till next status request in the backend system
Scope | Details |
---|---|
Aliases | - |
Type | int |
Mandatory | no |
Default | 60 |
Secret | no |
Configuration scope |
|
Resource references | none |
publishAllDownloadedResultFiles¶
If true, it publishes all downloaded files
Scope | Details |
---|---|
Aliases | - |
Type | bool |
Mandatory | no |
Default | false |
Possible values | - true - false |
Secret | no |
Configuration scope |
|
Resource references | none |
publishResultFilenames¶
Only the specified files get published, in case the file was not downloaded before an error occures
Scope | Details |
---|---|
Aliases | - |
Type | []string |
Mandatory | no |
Default | $PIPER_publishResultFilenames (if set) |
Secret | no |
Configuration scope |
|
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.
Scope | Details |
---|---|
Aliases | - |
Type | Jenkins Script |
Mandatory | yes |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
stopOnFirstError¶
If false, it does not stop if an error occured for one repository in the addonDescriptor, but continues with the next repository. However the step is marked as failed in the end if an error occured.
Scope | Details |
---|---|
Aliases | - |
Type | bool |
Mandatory | no |
Default | false |
Possible values | - true - false |
Secret | no |
Configuration scope |
|
Resource references | none |
subDirectoryForDownload¶
Target directory to store the downloaded files, {buildID} and {taskID} can be used and will be resolved accordingly
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | $PIPER_subDirectoryForDownload (if set) |
Secret | no |
Configuration scope |
|
Resource references | none |
treatWarningsAsError¶
If a warrning occures, the step will be set to unstable
Scope | Details |
---|---|
Aliases | - |
Type | bool |
Mandatory | no |
Default | false |
Possible values | - true - false |
Secret | no |
Configuration scope |
|
Resource references | none |
useFieldsOfAddonDescriptor¶
use fields of the addonDescriptor in the cpe as input values. Please enter in the format '[{"use":"Name","renameTo":"SWC"}]'
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | $PIPER_useFieldsOfAddonDescriptor (if set) |
Secret | no |
Configuration scope |
|
Resource references | none |
username¶
User
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | yes |
Default | $PIPER_username (if set) |
Secret | yes |
Configuration scope |
|
Resource references | none |
values¶
Input values for the build framework, please enter in the format '[{"value_id":"Id1","value":"value1"},{"value_id":"Id2","value":"value2"}]'
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | $PIPER_values (if set) |
Secret | no |
Configuration scope |
|
Resource references | none |
verbose¶
verbose output
Scope | Details |
---|---|
Aliases | - |
Type | bool |
Mandatory | no |
Default | false |
Possible values | - true - false |
Secret | no |
Configuration scope |
|
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 Cloud Platform ABAP Environment system or the Cloud Foundry API
Scope | Details |
---|---|
Aliases | - cfCredentialsId - credentialsId |
Type | string |
Configuration scope |
|
Examples¶
Configuration in the config.yml¶
If you want to use this step several time in one pipeline with different phases, the steps have to be put in different stages as it is not allowed to run the same step repeatedly in one stage.
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:
stage('MyPhase') {
steps {
abapEnvironmentBuild script: this
}
}
If you want to provide the host and credentials of the Communication Arrangement directly or you want to run in on premise, the configuration could look as follows:
stages:
MyPhase:
abapCredentialsId: 'abapCredentialsId',
host: 'https://myABAPendpoint.com',
Or by authenticating against Cloud Foundry and reading the Service Key details from there:
stages:
MyPhase:
abapCredentialsId: 'cfCredentialsId',
cfApiEndpoint : 'https://test.server.com',
cfOrg : 'cfOrg',
cfSpace: 'cfSpace',
cfServiceInstance: 'myServiceInstance',
cfServiceKeyName: 'myServiceKey',
One possible complete config example. Please note that the values are handed over as a string, which has inside a json structure:
stages:
MyPhase:
abapCredentialsId: 'abapCredentialsId'
host: 'https://myABAPendpoint.com'
certificateNames: ['myCert.cer']
phase: 'MyPhase'
values: '[{"value_id":"ID1","value":"Value1"},{"value_id":"ID2","value":"Value2"}]'
downloadResultFilenames: ['File1','File2']
publishResultFilenames: ['File2']
subDirectoryForDownload: 'MyDir'
filenamePrefixForDownload: 'MyPrefix'
treatWarningsAsError: true
maxRuntimeInMinutes: 360
pollingIntervallInSeconds: 15