# 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/.
---
# This file contains information about all the release artifacts that are
# needed within a type of release.
#
# Structure
# --------
# `bucket_paths`          -- prefix to be used per product to correctly access our buckets
# `default_locales`       -- list of locales to be used when composing upstream artifacts or the list of
#                      destinations. If given an empty locale, it uses these locales instead.
# `tasktype_map`          -- mapping between task reference and task type, particularly useful when
#                      composing the upstreamArtifacts for scriptworker.
# `platform_names`        -- various platform mappings used in reckoning artifacts or other paths
# `default`               -- a default entry, which the mappings extend and override in such a way that
#                      final path full-destinations will be a concatenation of the following:
#                      `bucket_paths`, `destinations`, `locale_prefix`, `pretty_name`
# `mapping`               -- the main section defining all artifacts to be archived
#
# Per-artifact fields (used within `mapping`):
# `from`                  -- specifies the dependency(ies) from which to expect the particular artifact
# `all_locales`           -- boolean argument to specify whether that particular artifact is to be expected
#                      for all locales or just the default one
# `description`           -- brief summary of what that artifact is
# `locale_prefix`         -- prefix to be used in the final destination paths, whether that's for default locale or not
# `source_path_modifier`  -- any parent dir that might be used in between artifact prefix and filename at source location
#                            for example `public/build` vs `public/build/ach/`.
# `destinations`          -- final list of directories where to push the artifacts
# `pretty_name`           -- the final name the artifact will have at destination
# `checksums_path`        -- the name to identify one artifact within the checksums file
# `expiry`                -- setting for expiring this file (GCS custom_time). ie: 1 year
# `not_for_platforms`     -- filtering option to avoid associating an artifact with a specific platform
# `only_for_platforms`    -- filtering option to exclusively include the association of an artifact for a specific platform
# `partials_only`         -- filtering option to avoid associating an artifact unless this flag is present
# `update_balrog_manifest`-- flag needed downstream in beetmover jobs to reckon the balrog manifest
# `from_buildid`          -- flag needed downstream in beetmover jobs to reckon the balrog manifest

bucket_paths:
    by-platform:
        .*devedition.*:
            - pub/devedition/candidates
        default:
            - pub/firefox/candidates
default_locales:
    - en-US
tasktype_map:
    beetmover-repackage: beetmover
    release-beetmover-signed-langpacks: signing
platform_names:
    path_platform:
        by-platform:
            linux64-shippable: 'linux-x86_64'
            linux64-devedition: 'linux-x86_64'
            linux64-aarch64-shippable: 'linux-aarch64'
            linux64-aarch64-devedition: 'linux-aarch64'
            macosx64-shippable: 'mac'
            macosx64-devedition: 'mac'
            win32-shippable: 'win32'
            win32-devedition: 'win32'
            win64-shippable: 'win64'
            win64-devedition: 'win64'
            win64-aarch64-shippable: 'win64-aarch64'
            win64-aarch64-devedition: 'win64-aarch64'
            linux64: 'linux-x86_64'
            linux64-aarch64: 'linux-aarch64'
            macosx64: 'mac'
            win32: 'win32'
            win64: 'win64'

default: &default
    from:
        - beetmover-repackage
    all_locales: true
    description: "TO_BE_OVERRIDDEN"
    locale_prefix: '${locale}/'
    source_path_modifier: ''
    destinations:
        - ${version}-candidates/build${build_number}/beetmover-checksums/${path_platform}
    expiry: "1 year"

mapping:
    target.checksums:
        <<: *default
        description: "Checksums file containing size, hash, sha algorithm and filename"
        pretty_name: firefox-${version}.checksums.beet
        checksums_path: beetmover-checksums/${path_platform}/${locale}/firefox-${version}.checksums.beet
    target-langpack.checksums:
        <<: *default
        description: "Checksums file containing size, hash, sha algorithm and filename for the langpack"
        locale_prefix: ''
        from:
            - release-beetmover-signed-langpacks
        pretty_name: ${locale}.checksums.beet
        checksums_path: beetmover-checksums/${path_platform}/xpi/${locale}.checksums.beet
        destinations:
            - ${version}-candidates/build${build_number}/beetmover-checksums/${path_platform}/xpi
