jenkins noob的问题......
是否有可能创建一种为所有阶段设置多个参数的选择? 目前我只能让用户自己选择每个参数值......
CODE:
pipeline {
...
parameters {
choice(
name : 'stage',
choices : 'DEV\nTEST\nQS\nPROD',
description : '''
<table>
<thead>
<tr>
<th>stage</th><th>nfs share name</th><th>swarm endpoint</th>
</tr>
</thead>
<tbody>
<tr><td>DEV</td> <td>DEV</td> <td>swarmid1</td></tr>
<tr><td>TEST</td><td>TEST</td><td>swarmid2</td></tr>
<tr><td>QS</td> <td>QS</td> <td></td></tr>
<tr><td>PROD</td><td>PROD</td><td></td></tr>
</tbody>
</table>
'''
)
****
SOME MAGIC SETTING THE PARAMETERS AS DESCRIBED IN THE DESCRIPTION
****
}
stages {
stage("do something") {
steps {
sh '''docker run ... ${MAGIC_NFS_SHARE} ...'''
}
}
}
}
提前THX!