# 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:
    - gecko_taskgraph.transforms.repo_update:transforms
    - gecko_taskgraph.transforms.task:transforms


task-defaults:
    worker:
        env:
            DO_HSTS:
                by-project:
                    mozilla-(central|beta|esr.*): "1"
                    default: ""
            DO_HPKP:
                by-project:
                    mozilla-(central|beta|esr.*): "1"
                    default: ""
            DO_REMOTE_SETTINGS:
                by-project:
                    mozilla-(central|beta|release|esr.*): "1"
                    default: ""
            DO_SUFFIX_LIST:
                by-project:
                    mozilla-(central|beta|esr.*): "1"
                    default: ""
            DO_MOBILE_EXPERIMENTS:
                by-project:
                    mozilla-(central|beta): "1"
                    default: ""
            USE_MOZILLA_CENTRAL:
                by-project:
                    mozilla-central: "1"
                    default: ""


tasks:
    hsts-hpkp-blocklist:
        name: periodic_file_update
        description: HSTS, HPKP and remote settings update
        run-on-projects: []  # Only run via cron
        treeherder:
            kind: build
            platform: linux64/opt
            symbol: pfu
            tier: 1
        worker-type: b-linux-xlarge-gcp
        worker:
            implementation: docker-worker
            os: linux
            docker-image: {in-tree: periodic-updates}
            max-run-time: 14400  # Takes up to 4 hours
            env:
                PRODUCT: firefox
                REVIEWERS: "#release-managers"
            command:
                - /runme.sh
            taskcluster-proxy: true
            artifacts:
                - name: 'public/build/nsSTSPreloadList.diff'
                  path: '/home/worker/artifacts/nsSTSPreloadList.diff'
                  type: file
                - name: 'public/build/StaticHPKPins.h.diff'
                  path: '/home/worker/artifacts/StaticHPKPins.h.diff'
                  type: file
                - name: 'public/build/remote-settings.diff'
                  path: '/home/worker/artifacts/remote-settings.diff'
                  type: file
                - name: 'public/build/initial_experiments.diff'
                  path: '/home/worker/artifacts/initial_experiments.diff'
                  type: file
        scopes:
            - secrets:get:project/releng/gecko/build/level-{level}/arc-phabricator-token
