Bug 1580778 - Migrate push-apk tasks to taskgraph (#5377)
parent
4462899763
commit
39da162dc9
@ -0,0 +1,56 @@
|
|||||||
|
# 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:
|
||||||
|
- fenix_taskgraph.pushapk:transforms
|
||||||
|
- taskgraph.transforms.task:transforms
|
||||||
|
|
||||||
|
kind-dependencies:
|
||||||
|
- old-decision
|
||||||
|
|
||||||
|
job-defaults:
|
||||||
|
description: Publish Fenix
|
||||||
|
worker-type: push-apk
|
||||||
|
worker:
|
||||||
|
commit: true
|
||||||
|
product: fenix
|
||||||
|
run-on-tasks-for: []
|
||||||
|
treeherder:
|
||||||
|
kind: build
|
||||||
|
tier: 1
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
dependencies:
|
||||||
|
signing: 'Signing Production task' # comes from the old-decision task
|
||||||
|
worker:
|
||||||
|
channel: production
|
||||||
|
certificate-alias: fenix
|
||||||
|
run-on-tasks-for: [github-release]
|
||||||
|
treeherder:
|
||||||
|
symbol: release-gp
|
||||||
|
|
||||||
|
nightly:
|
||||||
|
attributes:
|
||||||
|
nightly: true
|
||||||
|
dependencies:
|
||||||
|
signing: 'Signing Nightly task' # comes from the old-decision task
|
||||||
|
worker:
|
||||||
|
channel: nightly
|
||||||
|
google-play-track: internal
|
||||||
|
treeherder:
|
||||||
|
symbol: nightly-gp
|
||||||
|
|
||||||
|
nightly-legacy:
|
||||||
|
attributes:
|
||||||
|
nightly: true
|
||||||
|
dependencies:
|
||||||
|
signing: 'Signing Production task' # comes from the old-decision task
|
||||||
|
worker:
|
||||||
|
channel: production
|
||||||
|
google-play-track: nightly
|
||||||
|
treeherder:
|
||||||
|
symbol: production-gp
|
@ -0,0 +1,51 @@
|
|||||||
|
# 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/.
|
||||||
|
"""
|
||||||
|
Apply some defaults and minor modifications to the jobs defined in the build
|
||||||
|
kind.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
|
from taskgraph.transforms.base import TransformSequence
|
||||||
|
from taskgraph.util.treeherder import inherit_treeherder_from_dep
|
||||||
|
|
||||||
|
|
||||||
|
transforms = TransformSequence()
|
||||||
|
|
||||||
|
|
||||||
|
# TODO remove this transform once signing task are migrated to taskgraph
|
||||||
|
@transforms.add
|
||||||
|
def fetch_old_decision_dependency(config, tasks):
|
||||||
|
for task in tasks:
|
||||||
|
for dep_task in config.kind_dependencies_tasks:
|
||||||
|
expected_signing_dep_label = task['dependencies']['signing']
|
||||||
|
if dep_task.label != expected_signing_dep_label:
|
||||||
|
continue
|
||||||
|
|
||||||
|
task['primary-dependency'] = dep_task
|
||||||
|
yield task
|
||||||
|
|
||||||
|
|
||||||
|
@transforms.add
|
||||||
|
def build_pushapk_task(config, tasks):
|
||||||
|
for task in tasks:
|
||||||
|
dep = task.pop("primary-dependency")
|
||||||
|
task.setdefault("attributes", {}).update(dep.attributes.copy())
|
||||||
|
if "run_on_tasks_for" in task["attributes"]:
|
||||||
|
task["run-on-tasks-for"] = task["attributes"]["run_on_tasks_for"]
|
||||||
|
|
||||||
|
task["treeherder"] = inherit_treeherder_from_dep(task, dep)
|
||||||
|
task["worker"]["upstream-artifacts"] = [{
|
||||||
|
"taskId": {"task-reference": "<signing>"},
|
||||||
|
"taskType": "signing",
|
||||||
|
"paths": dep.attributes["apks"].values(),
|
||||||
|
}]
|
||||||
|
task["worker"]["dep"] = config.params["level"] != "3"
|
||||||
|
if not task["worker"].get("certificate-alias"):
|
||||||
|
task["worker"]["certificate-alias"] = "{}-{}".format(
|
||||||
|
task["worker"]["product"], task["worker"]["channel"]
|
||||||
|
)
|
||||||
|
|
||||||
|
yield task
|
@ -1,17 +0,0 @@
|
|||||||
# 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/.
|
|
||||||
|
|
||||||
from __future__ import absolute_import, print_function, unicode_literals
|
|
||||||
|
|
||||||
from taskgraph.target_tasks import _target_task as target_task
|
|
||||||
|
|
||||||
|
|
||||||
@target_task("nightly")
|
|
||||||
def target_tasks_nightly(full_task_graph, parameters, graph_config):
|
|
||||||
"""Select the set of tasks required for a nightly build."""
|
|
||||||
|
|
||||||
def filter(task, parameters):
|
|
||||||
return task.attributes.get("nightly", False)
|
|
||||||
|
|
||||||
return [l for l, t in full_task_graph.tasks.iteritems() if filter(t, parameters)]
|
|
Loading…
Reference in New Issue