首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Jenkins:[parameterized-trigger]属性文件

Jenkins:[parameterized-trigger]属性文件
EN

Stack Overflow用户
提问于 2019-03-04 23:16:10
回答 1查看 845关注 0票数 0

我使用"Parameterized Trigger Plugin“触发子任务。我使用"parametres from properties file“,并在"Use properties from file”中需要将文件名作为变量传递……我得到了这个错误。

代码语言:javascript
复制
[parameterized-trigger] Properties file $propeties_file did not exist.

enter image description here

EN

回答 1

Stack Overflow用户

发布于 2022-01-06 07:08:10

使用属性文件中的参数触发参数化构建的示例管道

代码语言:javascript
复制
pipeline {
      agent any
      stages {
        stage('S1') {
          steps {
            echo 'In S1'
            sh '''

        echo "param1=value1" > my.properties
        echo "param2=value2" >> my.properties
        '''
      }
    }
    stage('s2'){
      steps {
        script {
          def props = readProperties  file:"${WORKSPACE}/my.properties"
          build job: 'called_job', parameters: props.collect {string(name: it.key, value: it.value)}
        }
      }
    }
  }
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54986153

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档