0

这是我在此的头一篇博文。我是 YAML 的新手和 Jenkins 的初学者。我有一个要求,我必须multijob project使用 Jenkins Job builder创建一个project names我想存储为变量的地方。所以意图解释如下:

Multijob项目的工作定义:

job:
  name: test_job
  project-type: multijob
  builders:
    - multijob:
        name: PhaseOne
        condition: SUCCESSFUL
        projects:
          - name: PhaseOneJobA
            current-parameters: true
            git-revision: true
          - name: PhaseOneJobB
            current-parameters: true
            property-file: build.props

我想将以下部分存储在 List 变量中,比如说:JobsList

          - name: PhaseOneJobA
            current-parameters: true
          - name: PhaseOneJobB
            current-parameters: true

作为

 jobsList:
          - name: {list}
            current-parameters: true

列表在哪里

list:
  -JobA
  -JobB

这样我就可以在我的多任务定义中使用 JobsList。像这样的东西:

job:
  name: test_job
  project-type: multijob
  builders:
    - multijob:
        name: PhaseOne
        condition: SUCCESSFUL
        projects: JobsList

它扩展到

  job:
  name: test_job
  project-type: multijob
  builders:
    - multijob:
        name: PhaseOne
        condition: SUCCESSFUL
        projects:
          - name: JobA
            current-parameters: true
          - name: JobB
            current-parameters: true

任何建议,如何做到这一点?

-Archna

4

0 回答 0