0

我需要为 yamls 中的单个作业扩展发布者列表。我怎么能那样做:

job-template:
   name: "template name"
   publishers:
      - slack:
         room: "#room-1"

project:
   name: "project name"
   jobs:
      - test_job_1:
         branch: master

      - test_job_2:
         branch: not_master
         publishers:
            - slack:
               room: "#room-2"

我的意思是,将出版商扩展到test_job_2

4

1 回答 1

0

似乎最简单的方法是添加变量

job-template:
   slack_rooms: "#room-1"
   name: "template name"
   publishers:
      - slack:
         room: "{slack_rooms}"

project:
   name: "project name"
   jobs:
     - test_job_1:
        branch: master

     - test_job_2:
        branch: not_master
        slack_rooms: "#room-1,#room-2"
于 2019-11-14T15:59:01.973 回答