How can I do string to integer conversion in a Jenkinsfile?
问题 I have the following in my Jenkinsfile: pipeline { agent none environment { timeout_mins = 1 } options { timeout(time: "${env.timeout_mins}", unit: 'MINUTES') } stages { stage("test print") { steps { echo "timeout_mins: ${env.timeout_mins}" sh "sleep 120" } } } } I'd like to re-use environment params such as timeout_mins in multiple places, but need to convert it to integer in certain places for certain plugins. The error I get with the above example is as follows: Processing environment for