3

We are re-setting up our Jenkins server cause we had a stupid crash and lost all of our configuration. (Backups are now planned)

On of the first items of our multibranch pipeline groovy script is:

withEnv(['LB_PROJECT_ROOT=$WORKSPACE']) {

I put a

sh 'env'

just before that and i can see that WORKSPACE is set to a proper values. The path is allright and exists on the build node but the interpolation is not done in LB_PROJECT_ROOT. Instead, LB_PROJECT_ROOT ends up with the value "$WORKSPACE" which is failing our builds.

We are wondering if it might be a missing pluggin that could be doing that. Both "sh 'env'" before and after show that WORKSPACE is set and LB_PROJECT_ROOT is set only after the withEnv (Which makes sense) but with the wrong value!

Mathieu Dumoulin
  • 12,126
  • 7
  • 43
  • 71

1 Answers1

6

Maybe double quote the 'LB_PROJECT_ROOT=$WORKSPACE' instead of single quote?

burnettk
  • 13,557
  • 4
  • 51
  • 52
  • The difference between single and double quote can be further studied here: http://stackoverflow.com/a/6761591/4792410 – Rafał S Apr 17 '17 at 17:25
  • Thanks it was actually it and we found it earlier today, what strikes us is that this had always been working and suddenly, lost Jenkins, setup new server and stops working... Very fishy! – Mathieu Dumoulin Apr 17 '17 at 18:20