# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

loader: taskgraph.loader.transform:loader

transforms:
   - taskgraph.transforms.release_deps:transforms
   - taskgraph.transforms.release_balrog_publishing:transforms
   - taskgraph.transforms.job:transforms
   - taskgraph.transforms.task:transforms

kind-dependencies:
   - release-uptake-monitoring

job-defaults:
   description: Schedule publishing in balrog
   worker-type: buildbot-bridge/buildbot-bridge
   run-on-projects: []
   shipping-phase: ship
   run:
      using: buildbot
      release-promotion: true
   index:
      type: release
   notifications:
      completed:
         subject: "COMPLETED: [{task[shipping-product]} {release_config[version]} build{release_config[build_number]}/{config[params][project]}] {task_def[metadata][name]} task"
         message: "COMPLETED: [{task[shipping-product]} {release_config[version]} build{release_config[build_number]}/{config[params][project]}] {task_def[metadata][name]} task"
         plugins:
            by-project:
               mozilla-beta: ["log_collect"]
               mozilla-release: ["log_collect"]
               default: []

      failed:
         subject: "FAILED: [{task[shipping-product]} {release_config[version]} build{release_config[build_number]}/{config[params][project]}] {task_def[metadata][name]} task"
         message: "FAILED: [{task[shipping-product]} {release_config[version]} build{release_config[build_number]}/{config[params][project]}] {task_def[metadata][name]} task"
         plugins:
            by-project:
               mozilla-beta: ["log_collect", "ses"]
               mozilla-release: ["log_collect", "ses"]
               default: ["ses"]
         emails:
            by-project:
               mozilla-beta: ["release-automation-notifications@mozilla.com"]
               mozilla-release: ["release-automation-notifications@mozilla.com"]
               try: ["{task_def[metadata][owner]}"]
               maple: ["release+tcstaging@mozilla.com"]
               default: []

      exception:
         subject: "EXCEPTION: [{task[shipping-product]} {release_config[version]} build{release_config[build_number]}/{config[params][project]}] {task_def[metadata][name]} task"
         message: "EXCEPTION: [{task[shipping-product]} {release_config[version]} build{release_config[build_number]}/{config[params][project]}] {task_def[metadata][name]} task"
         plugins:
            by-project:
               mozilla-beta: ["log_collect", "ses"]
               mozilla-release: ["log_collect", "ses"]
               default: ["ses"]
         emails:
            by-project:
               mozilla-beta: ["release-automation-notifications@mozilla.com"]
               mozilla-release: ["release-automation-notifications@mozilla.com"]
               try: ["{task_def[metadata][owner]}"]
               maple: ["release+tcstaging@mozilla.com"]
               default: []
   routes:
      - index.releases.v1.{branch}.latest.{product}.latest.schedule_publishing_in_balrog
      - index.releases.v1.{branch}.{revision}.{product}.{underscore_version}.build{build_number}.schedule_publishing_in_balrog

jobs:
   firefox:
      name: release-firefox_schedule_publishing_in_balrog
      shipping-product: firefox
      run:
         product: firefox
         buildername: release-{branch}-firefox_schedule_publishing_in_balrog
         channels:
            by-project:
               birch: release
               maple: beta
               mozilla-beta: beta
               mozilla-release: release
               mozilla-esr52: esr
               mozilla-esr59: esr
               default: unknown
      index:
         product: firefox
   devedition:
      name: release-devedition_schedule_publishing_in_balrog
      shipping-product: devedition
      run:
         product: devedition
         buildername: release-{branch}-devedition_schedule_publishing_in_balrog
         channels: aurora
      index:
         product: devedition
