# 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

kind-dependencies:
    - toolchain
    - fetch

transforms:
    - gecko_taskgraph.transforms.build_schedules:transforms
    - gecko_taskgraph.transforms.job:transforms
    - gecko_taskgraph.transforms.task:transforms

task-defaults:
    run-on-repo-type: [hg]
    attributes:
        cron: true
    treeherder:
        kind: build
        tier: 2
    worker-type: b-linux-docker-xlarge-amd
    run:
        checkout: true
    worker:
        artifacts:
            - name: public/build
              type: directory
              path: /builds/worker/artifacts/
            - name: public/snapcraft-logs
              type: directory
              path: /builds/worker/.local/state/snapcraft/log
        max-run-time: 900
        env:
            UPLOAD_DIR: artifacts
            MOZ_STACKWALK_SYMBOLS_SERVER: '1'
    fetches:
        toolchain:
            - linux64-minidump-stackwalk

tasks:
    amd64-nightly/opt:
        description: Build Firefox Nightly as a Snap using upstream definition
        attributes:
            build_platform: linux64-snap
            build_type: opt
        index:
            product: firefox
            job-name: snap-amd64-nightly-opt
        worker:
            docker-image: {in-tree: snap-build-core24}
            max-run-time: 9000
        run:
            using: run-task
            command: >-
              ./run.sh nightly amd64
        treeherder:
            platform: linux64-snap/opt
            symbol: B-nightly(amd64)

    amd64-nightly/debug:
        description: Build Firefox Nightly (debug) as a Snap using upstream definition
        attributes:
            build_platform: linux64-snap
            build_type: debug
        index:
            product: firefox
            job-name: snap-amd64-nightly-debug
        worker:
            docker-image: {in-tree: snap-build-core24}
            max-run-time: 7200
        run:
            using: run-task
            command: >-
              ./run.sh nightly amd64 --debug
        treeherder:
            platform: linux64-snap/debug
            symbol: B-nightly(amd64)

    arm64-nightly/opt:
        description: Build Firefox Nightly as a Snap using upstream definition
        attributes:
            build_platform: linux-arm64-snap
            build_type: opt
        index:
            product: firefox
            job-name: snap-arm64-nightly-opt
        worker:
            docker-image: {in-tree: snap-build-core24}
            max-run-time: 9000
        run:
            using: run-task
            command: >-
              ./run.sh nightly arm64
        treeherder:
            platform: linux64-snap/opt
            symbol: B-nightly(arm64)

    arm64-nightly/debug:
        description: Build Firefox Nightly (debug) as a Snap using upstream definition
        attributes:
            build_platform: linux-arm64-snap
            build_type: debug
        index:
            product: firefox
            job-name: snap-arm64-nightly-debug
        worker:
            docker-image: {in-tree: snap-build-core24}
            max-run-time: 7200
        run:
            using: run-task
            command: >-
              ./run.sh nightly arm64 --debug
        treeherder:
            platform: linux64-snap/debug
            symbol: B-nightly(arm64)

    amd64-beta/opt:
        description: Build Firefox Beta as a Snap using upstream definition
        attributes:
            build_platform: linux64-snap
            build_type: opt
        index:
            product: firefox
            job-name: snap-amd64-beta-opt
        worker:
            docker-image: {in-tree: snap-build-core22}
            max-run-time: 9000
        run:
            using: run-task
            command: >-
              ./run.sh beta amd64
        treeherder:
            platform: linux64-snap/opt
            symbol: B-beta(amd64)

    amd64-beta/debug:
        description: Build Firefox Beta (debug) as a Snap using upstream definition
        attributes:
            build_platform: linux64-snap
            build_type: debug
        index:
            product: firefox
            job-name: snap-amd64-beta-debug
        worker:
            docker-image: {in-tree: snap-build-core22}
            max-run-time: 7200
        run:
            using: run-task
            command: >-
              ./run.sh beta amd64 --debug
        treeherder:
            platform: linux64-snap/debug
            symbol: B-beta(amd64)

    amd64-betacore24/opt:
        description: Build Firefox Beta (Core24) as a Snap using upstream definition
        attributes:
            build_platform: linux64-snap
            build_type: opt
        index:
            product: firefox
            job-name: snap-amd64-betacore24-opt
        worker:
            docker-image: {in-tree: snap-build-core24}
            max-run-time: 9000
        run:
            using: run-task
            command: >-
              ./run.sh beta-core24 amd64
        treeherder:
            platform: linux64-snap/opt
            symbol: B-beta24(amd64)

    amd64-betacore24/debug:
        description: Build Firefox Beta (Core24 debug) as a Snap using upstream definition
        attributes:
            build_platform: linux64-snap
            build_type: debug
        index:
            product: firefox
            job-name: snap-amd64-betacore24-debug
        worker:
            docker-image: {in-tree: snap-build-core24}
            max-run-time: 7200
        run:
            using: run-task
            command: >-
              ./run.sh beta-core24 amd64 --debug
        treeherder:
            platform: linux64-snap/debug
            symbol: B-beta24(amd64)

    amd64-stable/opt:
        description: Build Firefox Stable as a Snap using upstream definition
        attributes:
            build_platform: linux64-snap
            build_type: opt
        index:
            product: firefox
            job-name: snap-amd64-stable-opt
        worker:
            docker-image: {in-tree: snap-build-core22}
            max-run-time: 9000
        run:
            using: run-task
            command: >-
              ./run.sh stable amd64
        treeherder:
            platform: linux64-snap/opt
            symbol: B-stable(amd64)

    amd64-stable/debug:
        description: Build Firefox Stable (debug) as a Snap using upstream definition
        attributes:
            build_platform: linux64-snap
            build_type: debug
        index:
            product: firefox
            job-name: snap-amd64-stable-debug
        worker:
            docker-image: {in-tree: snap-build-core22}
            max-run-time: 7200
        run:
            using: run-task
            command: >-
              ./run.sh stable amd64 --debug
        treeherder:
            platform: linux64-snap/debug
            symbol: B-stable(amd64)

    amd64-stablecore24/opt:
        description: Build Firefox Stable (Core24) as a Snap using upstream definition
        attributes:
            build_platform: linux64-snap
            build_type: opt
        index:
            product: firefox
            job-name: snap-amd64-stablecore24-opt
        worker:
            docker-image: {in-tree: snap-build-core24}
            max-run-time: 9000
        run:
            using: run-task
            command: >-
              ./run.sh stable-core24 amd64
        treeherder:
            platform: linux64-snap/opt
            symbol: B-stable24(amd64)

    amd64-stablecore24/debug:
        description: Build Firefox Stable (Core24 debug) as a Snap using upstream definition
        attributes:
            build_platform: linux64-snap
            build_type: debug
        index:
            product: firefox
            job-name: snap-amd64-stablecore24-debug
        worker:
            docker-image: {in-tree: snap-build-core24}
            max-run-time: 7200
        run:
            using: run-task
            command: >-
              ./run.sh stable-core24 amd64 --debug
        treeherder:
            platform: linux64-snap/debug
            symbol: B-stable24(amd64)

    amd64-esr/opt:
        description: Build Firefox ESR 128 as a Snap using upstream definition
        attributes:
            build_platform: linux64-snap
            build_type: opt
        index:
            product: firefox
            job-name: snap-amd64-esr-opt
        worker:
            docker-image: {in-tree: snap-build-core22}
            max-run-time: 9000
        run:
            using: run-task
            command: >-
              ./run.sh esr amd64
        treeherder:
            platform: linux64-snap/opt
            symbol: B-esr(amd64)

    amd64-esr/debug:
        description: Build Firefox ESR 128 (debug) as a Snap using upstream definition
        attributes:
            build_platform: linux64-snap
            build_type: debug
        index:
            product: firefox
            job-name: snap-amd64-esr-debug
        worker:
            docker-image: {in-tree: snap-build-core22}
            max-run-time: 7200
        run:
            using: run-task
            command: >-
              ./run.sh esr amd64 --debug
        treeherder:
            platform: linux64-snap/debug
            symbol: B-esr(amd64)

    amd64-local/opt:
        description: Build Firefox Nightly as a Snap using upstream definition and local gecko checkout
        attributes:
            build_platform: linux64-snap
            build_type: opt
            cron: false
        run-on-projects:
            - mozilla-central
            - autoland
        index:
            product: firefox
            job-name: snap-amd64-opt
        worker:
            docker-image: {in-tree: snap-build-core24}
            max-run-time: 9000
        run:
            using: run-task
            command: >-
              ./run.sh try amd64
        treeherder:
            platform: linux64-snap/opt
            symbol: B-local(amd64)

    amd64-local/debug:
        description: Build Firefox Nightly (debug) as a Snap using upstream definition and local gecko checkout
        attributes:
            build_platform: linux64-snap
            build_type: debug
            cron: false
        run-on-projects:
            - mozilla-central
            - autoland
        index:
            product: firefox
            job-name: snap-amd64-debug
        worker:
            docker-image: {in-tree: snap-build-core24}
            max-run-time: 7200
        run:
            using: run-task
            command: >-
              ./run.sh try amd64 --debug
        treeherder:
            platform: linux64-snap/debug
            symbol: B-local(amd64)

    arm64-local/opt:
        description: Build Firefox Nightly as a Snap using upstream definition and local gecko checkout
        attributes:
            build_platform: linux-arm64-snap
            build_type: opt
            cron: false
        run-on-projects:
            - mozilla-central
            - autoland
        index:
            product: firefox
            job-name: snap-arm64-opt
        worker:
            docker-image: {in-tree: snap-build-core24}
            max-run-time: 9000
        run:
            using: run-task
            command: >-
              ./run.sh try arm64
        treeherder:
            platform: linux64-snap/opt
            symbol: B-local(arm64)

    arm64-local/debug:
        description: Build Firefox Nightly (debug) as a Snap using upstream definition and local gecko checkout
        attributes:
            build_platform: linux-arm64-snap
            build_type: debug
            cron: false
        run-on-projects:
            - mozilla-central
            - autoland
        index:
            product: firefox
            job-name: snap-arm64-debug
        worker:
            docker-image: {in-tree: snap-build-core24}
            max-run-time: 7200
        run:
            using: run-task
            command: >-
              ./run.sh try arm64 --debug
        treeherder:
            platform: linux64-snap/debug
            symbol: B-local(arm64)
