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

kind-dependencies:
   - push-apk
   - release-balrog-publishing
   - release-bouncer-aliases
   - release-version-bump

job-defaults:
   description: mark release as shipped in Ship-It
   worker-type:
      by-project:
         mozilla-central: scriptworker-prov-v1/shipit-v1
         mozilla-beta: scriptworker-prov-v1/shipit-v1
         mozilla-release: scriptworker-prov-v1/shipit-v1
         default: scriptworker-prov-v1/shipit-dev
   worker:
      implementation: shipit
   scopes:
      by-project:
         mozilla-beta: ['project:releng:ship-it:production']
         mozilla-release: ['project:releng:ship-it:production']
         default: ['project:releng:ship-it:staging']
   run-on-projects: []
   shipping-phase: ship
   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.mark_as_shipped
      - index.releases.v1.{branch}.{revision}.{product}.{underscore_version}.build{build_number}.mark_as_shipped

jobs:
   fennec:
      name: release-fennec_mark_as_shipped
      shipping-product: fennec
      index:
         product: fennec
   firefox:
      name: release-firefox_mark_as_shipped
      shipping-product: firefox
      index:
         product: firefox
   devedition:
      name: release-devedition_mark_as_shipped
      shipping-product: devedition
      index:
         product: devedition
