0

I need to extend the list of publishers for a single job in yamls. How can I do smth like that:

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"

I mean, to extend publishers in test_job_2

Egor
  • 153
  • 1
  • 2
  • 10

1 Answers1

0

Seems like the easiest way is to add variables

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"
Egor
  • 153
  • 1
  • 2
  • 10