forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1659691 - automation to run l10n-cross-channel in taskgraph cron.…
… r=taskgraph-reviewers,jmaher Differential Revision: https://phabricator.services.mozilla.com/D117253
- Loading branch information
1 parent
5b64d5d
commit 494511b
Showing
5 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# 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.cross_channel:transforms | ||
- taskgraph.transforms.job:transforms | ||
- taskgraph.transforms.task:transforms | ||
|
||
jobs: | ||
quarantine: | ||
description: Push strings from all shipping trains to the quarantine strings repo | ||
run-on-projects: [] | ||
worker-type: b-linux | ||
ssh-key-secret: | ||
by-level: | ||
"3": project/releng/gecko/build/level-3/l10n-cross-channel-quarantine-ssh | ||
default: null | ||
worker: | ||
docker-image: {in-tree: push-to-try} | ||
max-run-time: 3600 | ||
artifacts: | ||
- type: directory | ||
name: public/build | ||
path: /builds/worker/artifacts | ||
env: | ||
TASK_ID: {"task-reference": "<self>"} | ||
TASKCLUSTER_PROXY_URL: http://taskcluster | ||
treeherder: | ||
platform: firefox-release/opt | ||
tier: 1 | ||
kind: build | ||
symbol: Rel(l10n-cross-channel) | ||
run: | ||
using: mach | ||
actions: | ||
by-level: | ||
"3": ["prep", "create", "push"] | ||
default: ["prep", "create"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# 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/. | ||
""" | ||
Build a command to run `mach l10n-cross-channel`. | ||
""" | ||
|
||
from __future__ import absolute_import, print_function, unicode_literals | ||
|
||
from pipes import quote as shell_quote | ||
|
||
from taskgraph.transforms.base import TransformSequence | ||
from taskgraph.util.schema import resolve_keyed_by | ||
|
||
transforms = TransformSequence() | ||
|
||
|
||
@transforms.add | ||
def resolve_keys(config, jobs): | ||
for job in jobs: | ||
for item in ["ssh-key-secret", "run.actions"]: | ||
resolve_keyed_by(job, item, item, **{"level": str(config.params["level"])}) | ||
yield job | ||
|
||
|
||
@transforms.add | ||
def build_command(config, jobs): | ||
for job in jobs: | ||
command = [ | ||
"l10n-cross-channel", | ||
"-o", | ||
"/builds/worker/artifacts/outgoing.diff", | ||
"--attempts", | ||
"5", | ||
] | ||
ssh_key_secret = job.pop("ssh-key-secret") | ||
if ssh_key_secret: | ||
command.extend(["--ssh-secret", ssh_key_secret]) | ||
job.setdefault("scopes", []).append("secrets:get:{}".format(ssh_key_secret)) | ||
|
||
command.extend(job["run"].pop("actions", [])) | ||
job.setdefault("run", {}).update( | ||
{"using": "mach", "mach": " ".join(map(shell_quote, command))} | ||
) | ||
yield job |