Jenkins Job Builder错误:"未知的入口点或宏' reactive_choice'对于组件类型:'参数'。"

时间:2018-01-14 12:34:13

标签: jenkins

在使用jenkins作业构建器构建我的作业时,我无法定义新插件。 Jenkins UI有这些插件。我是JJB的新手,因此我不太确定如何定义这些新插件。这是我的YAML中使用的配置:

- job:
name: Run_Pipeline
project-type: freestyle
defaults: global
description: Build to pass variables for a pipeline
disabled: false
node: Linux
logrotate:
    numToKeep: 5
parameters:
    - choice:
      name: TYPE
      choices: ['DEV','QA']
- reactive_choice:
       name: ENV_NAME
       description: "Select environment (depending on Type) where the build has to be deployed"
       referencedParameters: TYPE
       script: |
        if (TYPE == 'DEV'){
            return['dev1','dev2','dev3']
        }else if(TYPE == 'QA'){
            return['qa1','qa2','qa3','qa4']
        }else{
            return['Uknown Type']
        }
        choiceType: PT_SINGLE_SELECT
        filterLength: 1

builders:
    - shell: |
        if [[ "$TYPE" == "QA" && "$PASSWORD" != "password" ]];then echo "Invalid Password for QA Deployment"; exit 1; fi

在通过jenkins-job builder运行此yaml时,我收到错误:

jenkins_jobs.errors.JenkinsJobsException: Unknown entry point or macro 'reactive_choice' for component type: 'parameter'.

我知道这个方法没有在模块parameters.py中定义;我在GITHub中找到了一个,但我不确定如何将该方法与现有的包集成。

https://github.com/ochirkov/jenkins-job-builder-active-choice-reactive-param

我错过了什么?任何帮助都非常感谢。

谢谢!

1 个答案:

答案 0 :(得分:0)

我明白了,这很简单。我在我的文件路径中安装了easy_install,我不得不从github运行包,如下所示:

For each ELEMENT in particular ROW and COLUMN

此链接非常有用 - http://setuptools.readthedocs.io/en/latest/easy_install.html 很简单!