jenkins-library: xsDeploy to XSA: Can't use interactive confirmation without console!
Hi experts,
get this issue, when we try to deploy our .mtar file. Can’t use interactive confirmation without console! The login seems to work, but deployment doesn’t work. Any ideas?
xsDeploy:
apiUrl: 'https://api.xxx:443'
credentialsId: 'gl_tbq_diraschk' # 'XS' is the default
dockerEnvVars: [http_proxy: "http://proxy:8080", https_proxy: "http://proxy:8080"]
docker:
dockerImage: '4d42e3c36023'
loginOpts: '--skip-ssl-validation'
org: 'orgname'
space: 'TBASE'
[Pipeline] { (hide)
[Pipeline] sh
info xsDeploy - Using stageName 'deploy' from env variable 'STAGE_NAME'
info xsDeploy - Project config: '.pipeline/config.yml'
info xsDeploy - Project defaults: '.pipeline/additionalConfigs/default_pipeline_environment.yml'
debug xsDeploy - Skipping fetching secrets from vault since it is not configured
debug xsDeploy - Mode: 'DEPLOY', Action: 'NONE'
debug xsDeploy - performLogin: true, performLogout: true
debug xsDeploy - Performing xs login. api-url: 'https://api.xxx:443', org: 'orgname', space: 'TBASE'
info xsDeploy - running shell script: /bin/bash #!/bin/bash
xs login -a https://api.xxx:443 -u **** -p '****' -o orgname -s TBASE --skip-ssl-validation
API_URL: https://api.xxx:443
The authenticity of host 'api.xxx' is not validated!
USERNAME: ****
Authenticating...
ORG: orgname
SPACE: TBASE
API endpoint: https://api.xxx:443 (API version: 1)
User: ****
Org: orgname
Space: TBASE
info xsDeploy - xs login has been performed. api-url: 'https://api.xxx:443', org: 'orgname', space: 'TBASE'
debug xsDeploy - Copying xs session file from home directory ('/home/piper/.xsconfig') to workspace ('.xsconfig')
debug xsDeploy - xs session file copied from home directory ('/home/piper/.xsconfig') to workspace ('.xsconfig')
debug xsDeploy - Copying xs session file from workspace ('.xsconfig') to home directory ('/home/piper/.xsconfig')
debug xsDeploy - xs session file copied from workspace ('.xsconfig') to home directory ('/home/piper/.xsconfig')
info xsDeploy - Performing xs deploy.
info xsDeploy - running shell script: /bin/bash #!/bin/bash
xs deploy TBASE_1.1.13.mtar
Can't use interactive confirmation without console!
debug xsDeploy - Performing xs logout.
info xsDeploy - running shell script: /bin/bash #!/bin/bash
xs logout
Logging out...
OK
info xsDeploy - xs logout has been performed
debug xsDeploy - xs session file '.xsconfig' has been deleted from workspace
warn xsDeploy - Here are the logs (/home/piper/.xs_logs):
info xsDeploy - File: '.xs_0.log.lock'
info xsDeploy - File: 'xs_0.log'
# XS command line client version: v1.0.131 (built 2020-12-17 14:23:11, codeline REL, SAP SE)
# [2021-04-13 17:01:54:448] xs login -a https://api.xxx:443 -u <hidden> -p <hidden> -o orgname -s TBASE --skip-ssl-validation
# XS command line client version: v1.0.131 (built 2020-12-17 14:23:11, codeline REL, SAP SE)
# [2021-04-13 17:01:58:213] xs deploy TBASE_1.1.13.mtar
[2021-04-13 17:02:01:163]-[CLI]-[error]-[.]-[.]: Can't use interactive confirmation without console!
# XS command line client version: v1.0.131 (built 2020-12-17 14:23:11, codeline REL, SAP SE)
# [2021-04-13 17:02:01:415] xs logout
Would like to watch the logs, but don’t know how to open the piper file"/home/piper" (unzip doesn’t work)
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15 (5 by maintainers)
ah, yes. The other xs deploy statements (issued by the
xsDeploy
step) are certainly executed on your end in a docker container or k8s pod. All the statements inside thesh
are most likely not.Preferred way for solving this is executing the
sh
also in a docker container. That docker container needs to be based on the same docker image which you are also using forxsDeploy
step itself. The step for using a docker container with the piper lib isdockerExecute
ordockerExecuteOnKubernetes
when using k8s. In prinicpledockerExecute
forwards todockerExecuteOnKubernetes
automagically. As an example for how to get this running see here. This is exactly the code which also controls the docker handling we executing thexsDeploy
step.This means basically:
Docu for dockerExecute step is here. Can also be differently by having the
sh
in another stage and configuring the docker image viaagent
on that stage. More details for that see here. In that case we don’t need thedockerExecute
from the piper lib.Just for having the complete picture: Another possibility would be to install the xs command line on the Jenkins where the
sh
is executed. But I clearly recommend the other way with using the docker image.Hope this helps & best regards, Marcus
… ahhh, forgot this: needs to be set separately. As outlined below
sh
is executed stand-alone and not inside a closure ofxsDeploy
.Hi @diraschk , you are using a declarative pipeline. In this case it should be something like this (without warranty, just as a sketch):
For the withCredentials part in declarative pipelines see also here
Hope this helps & best regards, Marcus