Reputation: 1
Running my jenkins pipeline I am able to have it output the commit message correctly using
gitnotes = sh ("git log -1 --pretty=%h%x09%an%x09%ad%x09%s")
8c65c33 NAME HERE Tue Nov 13 16:30:00 2018 -0500 Adjusted search/reset buttons' size in dashboard panel
However I now want to store those commit notes to a log file, but even when I use an echo it comes back as null.
echo "${gitnotes}"
I might be losing my mind, but how would I go about writing the above notes to a log file? I'm having a super bad day apparently as this is something I am just not looking at correctly.
Upvotes: 0
Views: 167
Reputation: 791
Try setting returnStdout: true
Eg: gitnotes = sh script: "git log -1 --pretty=%h%x09%an%x09%ad%x09%s" , returnStdout: true
Upvotes: 0