You might need to set up that variable as an environment variable for the shell to recognize it
https://jenkins.io/doc/pipeline/tour/environment https://stackoverflow.com/a/40718201 On Tue, Apr 16, 2019 at 15:23 b o b i <[email protected]> wrote: > I cannot make the executed shell to resolve a predefined variable in my > jenkins script.. I tried various syntax approaches w/o succcess. .. > > Anybody could give me a hand? > > > String workspace > String addOn = "Path/To/Cmake.cmake" > > node ('slave01') { > workspace = pwd() > String addOnAbsPath = "${workspace}/$toolchainCmake" > > stage ('Build') { > > // for some reason is not recognize, thats why > sh "echo ${addOnAbsPath}" > sh ''' > echo Path: '$addOnAbsPath' > ''' > sh '''#!/bin/bash > echo ${addOnAbsPath} > cmake ... -DADD_ON=$addOnAbsPath ... > ''' > } > } > > > -- > You received this message because you are subscribed to the Google Groups > "Jenkins Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jenkinsci-users/01535995-02a9-46ce-8388-ca01695dbbb9%40googlegroups.com > <https://groups.google.com/d/msgid/jenkinsci-users/01535995-02a9-46ce-8388-ca01695dbbb9%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CADgiF9KCHuh%3DMjmCPBb1OOk7x1Cppbs%2B4V38ALFeG6Lki_rg-A%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
