Hi,
We use in our Jenkins pipelines Git commands triggered by a Groovy script of the form:
echo sh(script:'git status', returnStdout: true)
When this command is triggered directly from the JenkinsFile file, the response is indeed retrieved in clear plain text:
On the other hand, when this command is triggered from a Jenkins SharedLib, then the response is unintelligible, probably because of an EBCDIC / ASCCI-UTF-8 conversion problem:
We do not understand where the problem comes from and therefore how to solve it...The issue is specific to Git for z/OS, as the other commands (vim in the example) show correct responses.
We also tested saving the git response to a file on the Jenkins workspace:
git status >output.txt
The output.txt file is correctly readable, and created on z/OS-USS with an ISO8859-1 ccsid.
User profile environment variables:
export _BPXK_AUTOCVT=ON
export _CEE_RUNOPTS="FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)"
export _TAG_REDIR_ERR=txt
export _TAG_REDIR_IN=txt
export _TAG_REDIR_OUT=txt
export PATH=/global/SYS9/OAD/bin:$PATH
export LIBPATH=/global/SYS9/OAD/lib:$LIBPATH
export MANPATH=/global/SYS9/OAD/share/man:$MANPATH
git config --global http.sslVerify false
git config --global core.pager ''
export GIT_SHELL=/global/SYS9/OAD/bin/bash
export GIT_EXEC_PATH=/global/SYS9/OAD/libexec/git-core
export GIT_TEMPLATE_DIR=/global/SYS9/OAD/share/git-core/templates
export IBM_JAVA_ENABLE_ASCII_FILETAG=ON
export DBB_HOME=/global/SYS9/DBB
export DBB_CONF=/var/DBB/conf
export GROOVY_HOME=$DBB_HOME/groovy-2.4.12
export CLASSPATH=$CLASSPATH:$DBB_CONF
export PATH=$GROOVY_HOME/bin:$DBB_HOME/bin:$JAVA_HOME/bin:$PATH
Jenkins agent configuration:
IBM_JAVA_COMMAND_LINE=java -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/u/JENKINS/tmpdir -Xnoargsconversion -Dorg.jenkinsci.plugins.gitclient.CliGitAPIImpl.user.name.file.encoding=IBM-1047 -Dorg.jenkinsci.plugins.gitclient.CliGitAPIImpl.user.password.file.encoding=IBM-1047 -Djavax.net.ssl.trustStore=/u/JENKINS/articacerts -Djavax.net.ssl.trustStorePassword=changeit -jar remoting.jar -workDir /u/JENKINS -jar-cache /u/JENKINS/remoting/jarCache -text
------------------------------
Fallai Denis
M
Self Registered
L'ISLE-ADAM FR
------------------------------