に読み込むJenkinsパイプラインでは、実行時に対話型入力をユーザーに与えるオプションを提供したいと考えています。私はgroovyスクリプトでユーザ入力をどのように読むことができるのか理解したい。Jenkinsパイプラインの対話型入力を変数
私は次のドキュメントを参照しています: https://jenkins.io/doc/pipeline/steps/pipeline-input-step/
EDIT-1:
pipeline {
agent any
stages {
stage("Interactive_Input") {
steps {
script {
def userInput = input(
id: 'userInput', message: 'Enter path of test reports:?',
parameters: [
[$class: 'TextParameterDefinition', defaultValue: 'None', description: 'Path of config file', name: 'Config'],
[$class: 'TextParameterDefinition', defaultValue: 'None', description: 'Test Info file', name: 'Test']
])
echo ("IQA Sheet Path: "+userInput['Config'])
echo ("Test Info file path: "+userInput['Test'])
}
}
}
}
}
:いくつかの試行後
私はこの作業を持っている要求は、サンプルコードで、私たちを助けるために
この例では、ユーザ入力パラメータをエコー(印刷)できます。
echo ("IQA Sheet Path: "+userInput['Config'])
echo ("Test Info file path: "+userInput['Test'])
しかし、これらのパラメータをファイルに書き込んだり、変数に割り当てることができません。どうすればこれを達成できますか?
現在のコードを表示してください。少なくともベーシック版を用意するのは難しいことではないでしょうか? – StephenKing