Re: env variable to be set across jenkinfile for each step

2018-10-28 Thread npwork101
Thank you for your reply. I did try what you had suggested, but it did not work. But i could be doing something wrong as well. Here is my step. pipeline { agent any stages { stage('Checkout') { steps { script { git(url: 'ssh://my.git', branch: 'testing',

Re: env variable to be set across jenkinfile for each step

2018-10-19 Thread Slide
You want to do something like this: def GIT_VER = sh(returnStdout: true, script: 'git tag... | tail -n1') Each invocation of sh will have it's own environment space. On Fri, Oct 19, 2018, 15:12 wrote: > Hi, > I have the following steps in my jenkinsfile that work pretty well with >

env variable to be set across jenkinfile for each step

2018-10-19 Thread npwork101
Hi, I have the following steps in my jenkinsfile that work pretty well with $GIT_VER=some number in the following step only. stage('Git Checkout') { steps { git(url: 'ssh://mygit/my.git', branch: 'develop') sh '''export GIT_VER=$(git tag -l [0-9].* --points-at