Skip to content

xsDeploy

Performs xs deployment

Description

Performs xs deployment

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

xsDeploy script: this

Command line

piper xsDeploy

Outputs

Output type Details
commonPipelineEnvironment
  • operationId

Parameters

Overview

Name Mandatory Additional information
apiUrl yes
credentialsId yes Jenkins only id of credentials (using credentials)
loginOpts yes
mode yes
mtaPath yes
org yes
password yes Secret pass via ENV or Jenkins credentials
script yes Jenkins only reference to Jenkins main pipeline script
space yes
user yes Secret pass via ENV or Jenkins credentials
action no
containerCommand no Jenkins only
containerShell no Jenkins only
deployOpts no
dockerEnvVars no Jenkins only
dockerImage no Jenkins only
dockerName no Jenkins only
dockerOptions no Jenkins only
dockerPullImage no Jenkins only
dockerVolumeBind no Jenkins only
dockerWorkspace no Jenkins only
operationId no
operationIdLogPattern no
verbose no activates debug output
xsSessionFile no

Details

action

Used for finalizing the blue-green deployment.

back to overview

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

apiUrl

The api url (e.g. https://example.org:12345

back to overview

Scope Details
Aliases -
Type string
Mandatory yes
Default $PIPER_apiUrl (if set)
Secret no
Configuration scope
  • ☒ parameter
  • ☐ general
  • ☒ steps
  • ☒ stages
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).

back to overview

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

containerShell

Jenkins-specific: Used for proper environment setup.

Allows to specify the shell to be executed for container with containerName.

back to overview

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

credentialsId

Jenkins-specific: Used for proper environment setup.

Jenkins username/password credential for accessing xs endpoint.

back to overview

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

deployOpts

Additional options appended to the deploy command. Only needed for sophisticated cases. When provided it is the duty of the provider to ensure proper quoting / escaping.

back to overview

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

dockerEnvVars

Jenkins-specific: Used for proper environment setup.

Environment variables to set in the container, e.g. [http_proxy: "proxy:8080"].

back to overview

Scope Details
Aliases -
Type map[string]string
Mandatory no
Default
Secret no
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
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.

back to overview

Scope Details
Aliases -
Type string
Mandatory no
Default
Secret no
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
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.

back to overview

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

dockerOptions

Jenkins-specific: Used for proper environment setup.

Docker options to be set when starting the container.

back to overview

Scope Details
Aliases -
Type []string
Mandatory no
Default
Secret no
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
Resource references none

dockerPullImage

Jenkins-specific: Used for proper environment setup.

Set this to 'false' to bypass a docker image pull. Usefull during development process. Allows testing of images which are available in the local registry only.

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

dockerVolumeBind

Jenkins-specific: Used for proper environment setup.

Volumes that should be mounted into the docker container.

back to overview

Scope Details
Aliases -
Type map[string]string
Mandatory no
Default
Secret no
Configuration scope
  • ☒ parameter
  • ☒ general
  • ☒ steps
  • ☒ stages
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.

back to overview

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

loginOpts

Additional options appended to the login command. Only needed for sophisticated cases. When provided it is the duty of the provider to ensure proper quoting / escaping.

back to overview

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

mode

Controls if there is a standard deployment or a blue green deployment. Values: 'DEPLOY', 'BG_DEPLOY'

back to overview

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

mtaPath

Path to deployable

back to overview

Scope Details
Aliases -
Type string
Mandatory yes
Default $PIPER_mtaPath (if set)
Secret no
Configuration scope
  • ☒ parameter
  • ☐ general
  • ☒ steps
  • ☒ stages
Resource references commonPipelineEnvironment:
  reference to: mtaPath

operationId

The operation ID. Used in case of bg-deploy in order to resume or abort a previously started deployment.

back to overview

Scope Details
Aliases -
Type string
Mandatory no
Default $PIPER_operationId (if set)
Secret no
Configuration scope
  • ☒ parameter
  • ☐ general
  • ☒ steps
  • ☒ stages
Resource references commonPipelineEnvironment:
  reference to: operationId

operationIdLogPattern

Regex pattern for retrieving the ID of the operation from the xs log.

back to overview

Scope Details
Aliases deployIdLogPattern
Type string
Mandatory no
Default ^.*xs bg-deploy -i (.*) -a.*$
Secret no
Configuration scope
  • ☒ parameter
  • ☐ general
  • ☒ steps
  • ☒ stages
Resource references none

org

The org

back to overview

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

password

Password

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

space

The space

back to overview

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

user

User

back to overview

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

xsSessionFile

The file keeping the xs session.

back to overview

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

Side effects

none

Example

xsDeploy
    script: this,
    mtaPath: 'path/to/archiveFile.mtar',
    credentialsId: 'my-credentials-id',
    apiUrl: 'https://example.org/xs',
    space: 'mySpace',
    org: 'myOrg'

Example configuration:

steps:
  <...>
  xsDeploy:
    mtaPath: path/to/archiveFile.mtar
    credentialsId: my-credentials-id
    apiUrl: https://example.org/xs
    space: mySpace
    org: myOrg