Skip to content

gctsRollback

Perfoms roll back of one (default) or several commit(s)

Description

This step performs a rollback of commit(s) in a local ABAP system repository. If a parameter is specified, it will be used as the target commit for the rollback. If no parameter is specified and the remote repository domain is 'github.com', the last commit with status 'success' will be used for the rollback. Otherwise, gctsRollback will rollback to the previously active commit in the local repository.

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 pipelines

gctsRollback script: this

Command line

piper gctsRollback

Prerequisites

This step performs a rollback of commit(s) in a local ABAP system repository. If a commit parameter is specified, it will be used as the target commit for the rollback. If no commit parameter is specified and the remote repository domain is 'github.com', the last commit with status 'success' will be used for the rollback. Otherwise, gctsRollback will rollback to the previously active commit in the local repository. Learn more about the SAP git-enabled Central Transport Sytem (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)
repository yes
script yes Jenkins only reference to Jenkins main pipeline script
username yes Secret pass via ENV or Jenkins credentials (abapCredentialsId)
commit no
githubPersonalAccessToken no Secret pass via ENV or Jenkins credentials (githubPersonalAccessTokenId)
verbose no activates debug output

Details

client

Specifies the client of the ABAP system to be adressed

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 deploy

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

githubPersonalAccessToken

GitHub personal access token with at least read permissions for the remote repository

back to overview

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

host

Specifies the protocol and host adress, including the port. Please provide in the format '://:'

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

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

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

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.

Jenkins credentials ID containing username and password for authentication to the ABAP system on which you want to perform the rollback

back to overview

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

githubPersonalAccessTokenId

Jenkins-specific: Used for proper environment setup.

GitHub personal access token with at least read permissions for the remote repository

back to overview

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

Example

Example configuration for the use in a Jenkinsfile.

gctsRollback(
  script: this,
  host: "https://abap.server.com:port",
  client: "000",
  abapCredentialsId: 'ABAPUserPasswordCredentialsId',
  repository: "myrepo"
  )

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

steps:
  <...>
  gctsRollback:
    host: "https://abap.server.com:port"
    client: "000"
    abapCredentialsId: 'ABAPUserPasswordCredentialsId'
    repository: "myrepo"