
Jenkins에서는 속성 폴더에 설정된 매개변수의 값에 따라 매개변수 섹션에 필드를 설정하고 싶습니다.
스테이지 섹션 외부에서 withFolderProperties를 사용하려고 할 때마다 오류가 발생합니다. 그래서 다음 질문을 할게요...
필요에 따라 사용할 수 있나요?
여기 내 코드 :
pipeline {
agent {
label "xxx.yyy"
}
parameters {
/* it doen't work*/
withFolderProperties{
choice(name: 'Projet', choices: [${cicdListeProjets}], description: 'Projet concerne')
}
}
tools {
jdk 'openjdk-8'
}
options {
buildDiscarder(logRotator(numToKeepStr: '5'))
disableConcurrentBuilds()
}
stages {
stage('Checkout') {
steps {
checkout(...)
}
}
stage('Build') {
steps {
sh """
echo "$Projet"
"""
}
}
}
}
감사해요
답변1
에 따르면선적 서류 비치는 withFolderProperties
파이프라인 단계입니다. 단계~ 해야 하다steps
선언적 파이프라인의 섹션 에 배치됩니다 .