Reputation: 440
I'm trying to call a variable in my Jenkinsfile from a script statement with triple double-quotes string as shown below:
sh(script: """
python -m flake8 ${APP}
""")
This doesn't seem to be working as a get an error like :
No such property: imageNameParameter for class: genericJenkinsfile
The variable is declared like this at the beginning of the file
def APP = body.appName
I also tried various changes like using env.APP or using simple quotes around ${APP} but it didn't work either. Any thoughts ?
Upvotes: 2
Views: 1749
Reputation: 440
I finally got it to work, for a reason that I can't really tell the triple string syntax uses only $APP to be called inside script:
Here's the solution:
sh(script: """
python -m flake8 $APP
""")
Upvotes: 3