我想通過Jenkinsfile獲取用戶輸入,但我無法在shell中使用它。下面是代碼:如何在shell中獲取用戶輸入數據(Jenkinsfile)
def userInput = timeout(time:60, unit:'SECONDS') {input(
id: 'userInput', message: 'URL Required', parameters: [
[$class: 'TextParameterDefinition', defaultValue: '', description: 'URL', name: 'url'],
])
}
node{
echo "Env jsfsjaffwef:"+userInput) //this works
echo "${userInput}" //but this does not
sh '''
python test.py ${userInput}
'''
}
你真的確定'echo'$ {userInput}「'does not _ work does not work?什麼是「不工作」順便說一句? – StephenKing