Skip to content

gctsDeploy

Deploys a Git Repository to a local Repository and then to an ABAP System

Description

This step deploys a remote Git repository to a local repository on an ABAP system and imports the content in the ABAP database. If the repository does not yet exist in the system, this step also creates it. If the repository already exists on the ABAP system, this step executes the remaining actions of the step, depending on the parameters provided for the step. These actions include, for example, deploy a specific commit to the ABAP system, or deploy the current commit of a specific branch. You can use this step for gCTS as of SAP S/4HANA 2020.

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')

gctsDeploy script: this
piper gctsDeploy

Prerequisites

If you provide a commit ID, the step deploys the content of the specified commit to the ABAP system. If you provide a branch, the step deploys the content of the specified branch. If you set the rollback parameter to true, the step returns to a working state of the repository, if the deployment of the specified commit or branch fails. More information about the Git-enabled Change and Transport System (gCTS).

Parameters

Overview - Step

Name Mandatory Additional information
client yes
host yes
password (yes) Secret pass via ENV or Jenkins credentials (abapCredentialsId)
remoteRepositoryURL yes
repository yes
script (yes) Jenkins only reference to Jenkins main pipeline script
username (yes) Secret pass via ENV or Jenkins credentials (abapCredentialsId)
branch no
commit no
configuration no
queryParameters no
role no
rollback no
scope no
skipSSLVerification no
type no
vSID 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

Details

branch

Name of a branch, if you want to deploy the content of a specific branch to the ABAP system.

back to overview

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

client

Client of the ABAP system to which you want to deploy the repository

back to overview

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

commit

ID of a specific commit, if you want to deploy the content of the specified commit.

back to overview

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

configuration

Configuration parameters for the repository. Provide the parameters as a key-value pair map in the following format: <configuration parameter>:<Value>. For a list of available configuration parameters, see Configuration Parameters for Repositories.

back to overview

Scope Details
Aliases gctsRepositoryConfigurations
Type map[string]interface{}
Mandatory no
Default $PIPER_configuration (if set)
Secret no
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
Resource references none

host

Protocol and host of the ABAP system, including the port. Please provide in the format <protocol>://<host>:<port>. Supported protocols are http and https.

back to overview

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

password

Password of the ABAP user that authenticates to the ABAP system. Note - DonĀ“t provide this parameter directly. Either set it in the environment, or in the Jenkins credentials store, and provide the ID as value of the abapCredentialsId parameter.

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

queryParameters

Add query parameters (for API requests) that apply to all endpoints of the step. Provide the parameters as key-value pair map in the format <query parameter>:<value>.

back to overview

Scope Details
Aliases -
Type map[string]interface{}
Mandatory no
Default $PIPER_queryParameters (if set)
Secret no
Configuration scope
  • ☒ parameter
  • ☐ general
  • ☒ steps
  • ☒ stages
Resource references none

remoteRepositoryURL

URL of the remote repository

back to overview

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

repository

Specifies the name (ID) of the local repsitory on the ABAP system

back to overview

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

role

Role of the local repository. Possible values are SOURCE (for repositories on development systems - Default) and TARGET (for repositories on target systems). Local repositories with a TARGET role cannot be the source of code changes.

back to overview

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

rollback

Indication whether you want to roll back to the last working state of the repository, if any of the step actions switch branch or pull commit fail.

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

scope

Scope of objects to be deployed. Possible values are CRNTCOMMIT (current commit - Default) and LASTACTION (last repository action). The default option deploys all objects that existed in the repository when the commit was created. LASTACTION only deploys the object difference of the last action in the repository.

back to overview

Scope Details
Aliases -
Type string
Mandatory no
Default $PIPER_scope (if set)
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

skipSSLVerification

Skip the verification of SSL (Secure Socket Layer) certificates when using HTTPS. This parameter is not recommended for productive environments.

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

type

Type of the used source code management tool

back to overview

Scope Details
Aliases -
Type string
Mandatory no
Default GIT
Possible values - GIT
- GITHUB
- GITLAB
Secret no
Configuration scope
  • ☒ parameter
  • ☐ general
  • ☒ steps
  • ☒ stages
Resource references none

username

User that authenticates to the ABAP system. Note - Don't provide this parameter directly. Either set it in the environment, or in the Jenkins credentials store, and provide the ID as value of the abapCredentialsId parameter.

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

vSID

Virtual SID of the local repository. The vSID corresponds to the transport route that delivers content to the remote Git repository. For more information, see Background Information - vSID on SAP Help Portal.

back to overview

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

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.

ID taken from the Jenkins credentials store containing the user name and password of the user that authenticates to the ABAP system.

back to overview

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

Example

Example configuration for the use in a Jenkinsfile.

gctsDeploy(
  script: this,
  host: 'https://abap.server.com:port',
  client: '000',
  abapCredentialsId: 'ABAPUserPasswordCredentialsId',
  repository: 'myrepo',
  remoteRepositoryURL: "https://remote.repository.url.com",
  role: 'SOURCE',
  vSID: 'ABC',
  branch: 'feature1',
  commit: '95952ec',
  scope: 'LASTACTION',
  rollback: true,
  configuration: [VCS_AUTOMATIC_PULL: 'FALSE',VCS_AUTOMATIC_PUSH: 'FALSE',CLIENT_VCS_LOGLVL: 'debug'],
  queryparameters: [saml2: 'disabled']
)

Example for the use in a YAML configuration file (such as .pipeline/config.yaml).

steps:
  <...>
  gctsDeploy:
    host: 'https://abap.server.com:port'
    client: '000'
    abapCredentialsId: 'ABAPUserPasswordCredentialsId'
    repository: 'myrepo'
    remoteRepositoryURL: "https://remote.repository.url.com"
    role: 'SOURCE'
    vSID: 'ABC'
    branch: 'feature2'
    commit: '0c9d330'
    scope: 'CRNTCOMMIT'
    rollback: false
    configuration:
        VCS_AUTOMATIC_PULL: "FALSE"
        VCS_AUTOMATIC_PUSH: "FALSE"
        CLIENT_VCS_LOGLVL: "debug"
    queryparameters:
        saml2: "disabled"