我有一个像python3 test.py arg1 arg2那样运行的python脚本
我设置了一个jenkins任务,并用两个字符串参数将其参数化。
如何设置我的Jenkinsfile?这就是我现在的全部
pipeline {
agent any
stages {
stage('version') {
steps {
sh 'python3 --version'
}
}
stage('hello') {
steps {
sh 'python3 temp.py'
}
}
}
}发布于 2022-10-16 16:49:24
你在找下面这样的东西吗?
pipeline {
agent any
parameters {
string(name: 'param1', defaultValue: 'test', description: '')
string(name: 'param2', defaultValue: 'test2', description: '')
}
stages {
stage('version') {
steps {
sh 'python3 --version'
}
}
stage('hello') {
steps {
sh "python3 temp.py ${params.param1} ${params.param2}"
}
}
}
}https://stackoverflow.com/questions/74087537
复制相似问题