Re: Workflow: extract git revision and build a timestamp

2015-12-09 Thread Guy Matz
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

Workflow: extract git revision and build a timestamp

2015-11-12 Thread Jens Wilke
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}"