I know I should know the answer to this one, but it's eluding me. When I run git describe from within a Jenkins pipeline, I am getting different results from when git describe is run from a normal clone/checkout. This happens even if I move to a detached head state.
Obviously I'm missing an option in the Git clone in Jenkins but I can't figure out what I'm missing. The current checkout is:
checkout([$class: 'GitSCM',
changelog: true,
poll: true,
branches: [[name: 'master']],
extensions: [
[$class: 'CleanBeforeCheckout'],
[$class: 'SubmoduleOption', disableSubmodules: false, parentCredentials: true,
recursiveSubmodules: true, reference: '', trackingSubmodules: false]],
doGenerateSubmoduleConfigurations: false, extensions: [
[$class: 'CleanCheckout'],
[$class: 'CloneOption', timeout: 60, shallow: true],
[$class: 'CheckoutOption', timeout: 60],
],
userRemoteConfigs: [[url: 'git://
git.samba.org/rsync.git']]])
shallow makes no difference - I don't think it's supported anymore, correct?
Inside Jenkins, git describe reports 47351c2b.
In a standard clone, detached head (or on a branch) at this commit, I get v3.2.3pre1-9-g47351c2b, which is what I'm expecting.
Thanks,
Randall