# 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.beetmover_cdns:transforms
   - taskgraph.transforms.task:transforms

kind-dependencies:
   - release-generate-checksums

job-defaults:
   worker-type:
      by-project:
         mozilla-release: scriptworker-prov-v1/beetmoverworker-v1
         mozilla-beta: scriptworker-prov-v1/beetmoverworker-v1
         default: scriptworker-prov-v1/beetmoverworker-dev
   run-on-projects: []
   shipping-phase: push
   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: []

jobs:
   fennec-push-to-cdns:
      name: fennec_push_to_cdns
      product: fennec
      shipping-product: fennec
      routes:
         - index.releases.v1.{branch}.latest.fennec.latest.beetmover_cdns
         - index.releases.v1.{branch}.{revision}.fennec.{underscore_version}.build{build_number}.beetmover_cdns
      treeherder-platform: Android/opt
      index:
         product: fennec
   devedition-push-to-cdns:
      name: devedition_push_to_cdns
      product: devedition
      shipping-product: devedition
      routes:
         - index.releases.v1.{branch}.latest.devedition.latest.beetmover_cdns
         - index.releases.v1.{branch}.{revision}.devedition.{underscore_version}.build{build_number}.beetmover_cdns
      treeherder-platform: Linux64-devedition/opt
      index:
         product: devedition
   firefox-push-to-cdns:
      name: firefox_push_to_cdns
      product: firefox
      shipping-product: firefox
      routes:
         - index.releases.v1.{branch}.latest.firefox.latest.beetmover_cdns
         - index.releases.v1.{branch}.{revision}.firefox.{underscore_version}.build{build_number}.beetmover_cdns
      treeherder-platform: Linux64/opt
      index:
         product: firefox
