I used your provided code in windows and following is output
just changed like below
ws(dir: WORKSPACE )
OUTPUT:
Started by user Imran Raza Khan
> git.exe rev-parse --is-inside-work-tree # timeout=10
Setting origin to https://my.com/scm/java/my.git
> git.exe config remote.origin.url https://my.com/scm/java/my.git # timeout=10
Fetching origin...
Fetching upstream changes from origin
> git.exe --version # timeout=10
using GIT_ASKPASS to set credentials
> git.exe fetch --tags --progress origin +refs/heads/:refs/remotes/origin/
Seen branch in repository origin/TEST-555
Seen branch in repository origin/TESTJENKINS
Seen branch in repository origin/master
Seen branch in repository origin/test
Seen 4 remote branches
Obtained Jenkinsfile from 6895d05d313977e329519d17c5074a0b334be8cf
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] node
Running on Jenkins in C:\Users\imran\.jenkins\workspace\e-multipipeline_TESTJENKINS-WB7B2SPPZGFQC74ER3V7H4MZCMM7MPKNLHALQPJ5OVCWHK3MYM7A
[Pipeline] {
[Pipeline] stage
[Pipeline]
{ (Declarative: Checkout SCM) [Pipeline] checkout > git.exe rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository > git.exe config remote.origin.url https://my.com/scm/java/my.git # timeout=10 Fetching without tags Fetching upstream changes from https://my.com/scm/java/my.git > git.exe --version # timeout=10 using GIT_ASKPASS to set credentials > git.exe fetch --no-tags --progress https://my.com/scm/java/my.git +refs/heads/*:refs/remotes/origin/* Checking out Revision 6895d05d313977e329519d17c5074a0b334be8cf (TESTJENKINS) > git.exe config core.sparsecheckout # timeout=10 > git.exe checkout -f 6895d05d313977e329519d17c5074a0b334be8cf Commit message: "update Jenkins Pipeline WIP" > git.exe rev-list --no-walk 211e9cf1009aa872739b9c5d21289711c332d0af # timeout=10 [Pipeline] }
[Pipeline] // stage
[Pipeline] withEnv
[Pipeline] {
[Pipeline] stage
[Pipeline] { (parallel)
[Pipeline] parallel
[Pipeline] [windows] { (Branch: windows)
[Pipeline] [windows] stage
[Pipeline] [windows] { (windows)
[Pipeline] [windows] echo
[windows] pipeline GIT_COMMIT before windows ws is 6895d05d313977e329519d17c5074a0b334be8cf
[Pipeline] [windows] ws
[windows] Running in C:\Users\imran\.jenkins\workspace\e-multipipeline_TESTJENKINS-WB7B2SPPZGFQC74ER3V7H4MZCMM7MPKNLHALQPJ5OVCWHK3MYM7A@2
[Pipeline] [windows]
{ [Pipeline] [windows] echo [windows] pipeline GIT_AUTHOR_NAME in windows ws is null [Pipeline] [windows] bat [windows] [e-multipipeline_TESTJENKINS-WB7B2SPPZGFQC74ER3V7H4MZCMM7MPKNLHALQPJ5OVCWHK3MYM7A@2] Running batch script [windows] [windows] C:\Users\imran\.jenkins\workspace\e-multipipeline_TESTJENKINS-WB7B2SPPZGFQC74ER3V7H4MZCMM7MPKNLHALQPJ5OVCWHK3MYM7A@2>echo bat GIT_COMMITTER_NAME in windows ws is [windows] bat GIT_COMMITTER_NAME in windows ws is [Pipeline] [windows] }
[Pipeline] [windows] // ws
[Pipeline] [windows] echo
[windows] pipeline GIT_COMMIT after windows ws is 6895d05d313977e329519d17c5074a0b334be8cf
[Pipeline] [windows] bat
[windows] [e-multipipeline_TESTJENKINS-WB7B2SPPZGFQC74ER3V7H4MZCMM7MPKNLHALQPJ5OVCWHK3MYM7A] Running batch script
[windows]
[windows] C:\Users\imran\.jenkins\workspace\e-multipipeline_TESTJENKINS-WB7B2SPPZGFQC74ER3V7H4MZCMM7MPKNLHALQPJ5OVCWHK3MYM7A>echo bat GIT_COMMIT after windows ws is 6895d05d313977e329519d17c5074a0b334be8cf
[windows] bat GIT_COMMIT after windows ws is 6895d05d313977e329519d17c5074a0b334be8cf
[Pipeline] [windows] bat
[windows] [e-multipipeline_TESTJENKINS-WB7B2SPPZGFQC74ER3V7H4MZCMM7MPKNLHALQPJ5OVCWHK3MYM7A] Running batch script
[windows]
[windows] C:\Users\imran\.jenkins\workspace\e-multipipeline_TESTJENKINS-WB7B2SPPZGFQC74ER3V7H4MZCMM7MPKNLHALQPJ5OVCWHK3MYM7A>echo hello windows from IMRAN-118
[windows] hello windows from IMRAN-118
[Pipeline] [windows] }
[Pipeline] [windows] // stage
[Pipeline] [windows] }
[Pipeline] // parallel
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS
I believe you're making syntactic mistakes rather than missing the values of GIT_COMMITTER_NAME and GIT_AUTHOR_NAME. Refer to the example declarative pipeline job in my JENKINS-52511 branch for working examples.
The GIT_COMMITTER_NAME and GIT_AUTHOR_NAME in that example show that
JENKINS-45489is still an open bug. That bug reports that the value assigned to GIT_COMMITTER_NAME and GIT_AUTHOR_NAME is incorrect if a Pipeline shared library was loaded along with the working repository. The value assigned to GIT_COMMIT is the SHA-1 of the commit which declarative pipeline used in its implicit checkout. Unfortunately, the value assigned to GIT_AUTHOR_NAME and GIT_COMMITTER_NAME is from the most recent commit to the Pipeline shared library.You might also refer to the related Jenkins minute video.