으로 읽습니다. Jenkins 파이프 라인에서 런타임에 대화 형 입력을 제공하는 옵션을 사용자에게 제공하려고합니다. Groovy 스크립트에서 사용자 입력을 읽을 수있는 방법을 알고 싶습니다.Jenkins 파이프 라인의 대화 형 입력을 변수
내가 다음 설명서를 참조하고 있습니다 : https://jenkins.io/doc/pipeline/steps/pipeline-input-step/
편집-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