I do believe the plugin sets the var you want. have a look at
Environment variables here:
https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin#GitPlugin-AdvancedFeatures
On Thu, Nov 12, 2015 at 12:41 PM, Jens Wilke
wrote:
> Hi all,
>
> for extracting a git revision and building a timestamp at
Hi all,
for extracting a git revision and building a timestamp at the beginning of
a job I have now the following code:
stage 'build'
node {
git ''
sh 'xy=`git rev-parse HEAD | cut -c1-11`; echo -n $xy > git-revision'
def rev11 = readFile 'git-revision'
echo "Git revision ${rev11}"