Skip to content

gctsDeploy

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

Description

The steps deploys a git repository to an ABAP System. If a repository does not exists in the system, it creates and clones it to the local repository and then deploys it into the ABAP system.

Usage

We recommend to define values of step parameters via config.yml file. In this case, calling the step is reduced to one simple line.
Calling the step can be done either via the Jenkins library step or on the command line.

Jenkins Pipeline

library('piper-lib-os')

gctsDeploy script: this

Command Line

piper gctsDeploy

Prerequisites

With this step you can deploy a remote Git repository to a local repository on an ABAP server. If a commit parameter is specified the step would pull the repository to the commit that was mentioned. If a branch is provided then the repository would be switched to the respective branch specified. The rollback flag can be used to decide if you want a rollback to the working state of the reposiotry in the case of a failure. Learn more about the SAP Git-enabled Change & Transport System (gCTS) here. With gCTS, ABAP developments on ABAP servers can be maintained in Git repositories.

Parameters

Overview

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
role no
rollback no
scope no
type no
vSID no
verbose no activates debug output

Details

branch

Name of the branch to which the deploy has to be done to.

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

Specifies the client of the ABAP system to be addressed

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

Specifies the commit to be deployed

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

Defines the configuration values for the repository. This map needs to be created as configKeyName:configKeyValue

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

Specifies the protocol and host address, 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 to authenticate to the ABAP system

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

remoteRepositoryURL

URL of the corresponding 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. Choose between 'TARGET' and 'SOURCE'. Local repositories with a TARGET role will NOT be able to be the source of code changes

back to overview

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

rollback

The rollback flag for a failure during the deploy step. A true value would mean gCTS would roll back to the last clean state

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

The scope of the gcts deploy api call

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

type

Type of the used source code management tool

back to overview

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

username

User to authenticate to the ABAP system

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

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.

Jenkins credentials ID containing username and password for authentication to the ABAP system on which you want to deploy a commit

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: 'branch',
  commit: 'commit',
  scope: 'scope',
  rollback: false,
  configuration: [dummyConfig: 'dummyval']
)

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: 'branch'
    commit: 'commit'
    scope: 'scope'
    rollback: false
    configuration:
        dummyconfig: "dummyval"