Make nimbledroid not depend on a real token on staging releases (#7570)
parent
cb18049c0e
commit
cb7791d7ed
|
@ -38,5 +38,9 @@ token_file = sys.argv[2]
|
||||||
with open(token_file) as f:
|
with open(token_file) as f:
|
||||||
key = f.read()
|
key = f.read()
|
||||||
|
|
||||||
|
if key.rstrip() == '--':
|
||||||
|
print('Nimbledroid key "--" detected. Not uploading anything to the service.')
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
with open(apk_path) as apk_file:
|
with open(apk_path) as apk_file:
|
||||||
uploadApk({'apk': apk_file}, key)
|
uploadApk({'apk': apk_file}, key)
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
loader: taskgraph.loader.transform:loader
|
loader: taskgraph.loader.transform:loader
|
||||||
|
|
||||||
transforms:
|
transforms:
|
||||||
|
- fenix_taskgraph.transforms.nimbledroid:transforms
|
||||||
- taskgraph.transforms.job:transforms
|
- taskgraph.transforms.job:transforms
|
||||||
- taskgraph.transforms.task:transforms
|
- taskgraph.transforms.task:transforms
|
||||||
|
|
||||||
|
@ -18,9 +19,17 @@ job-defaults:
|
||||||
using: run-commands
|
using: run-commands
|
||||||
use-caches: false
|
use-caches: false
|
||||||
secrets:
|
secrets:
|
||||||
- name: project/mobile/fenix/nimbledroid
|
by-level:
|
||||||
key: api_key
|
'3':
|
||||||
path: .nimbledroid_token
|
- name: project/mobile/fenix/nimbledroid
|
||||||
|
key: api_key
|
||||||
|
path: .nimbledroid_token
|
||||||
|
default: []
|
||||||
|
pre-commands:
|
||||||
|
by-level:
|
||||||
|
'3': []
|
||||||
|
default:
|
||||||
|
- [echo, '--', '>', .nimbledroid_token]
|
||||||
run-on-tasks-for: []
|
run-on-tasks-for: []
|
||||||
treeherder:
|
treeherder:
|
||||||
kind: test
|
kind: test
|
||||||
|
@ -39,16 +48,15 @@ jobs:
|
||||||
signing: signing-nightly
|
signing: signing-nightly
|
||||||
run:
|
run:
|
||||||
commands:
|
commands:
|
||||||
- [wget, {artifact-reference: '<signing/public/build/armeabi-v7a/geckoNightly/target.apk>'}, '-O', target.apk]
|
- [wget, {artifact-reference: '<signing/public/build/armeabi-v7a/geckoNightly/target.apk>'}, '-O', target.apk]
|
||||||
- [python, automation/taskcluster/upload_apk_nimbledroid.py, target.apk, .nimbledroid_token]
|
- [python, automation/taskcluster/upload_apk_nimbledroid.py, target.apk, .nimbledroid_token]
|
||||||
|
|
||||||
treeherder:
|
treeherder:
|
||||||
symbol: nightly(nimbledroid)
|
symbol: nightly(nimbledroid)
|
||||||
|
|
||||||
production:
|
production:
|
||||||
attributes:
|
attributes:
|
||||||
release-type: production
|
release-type: production
|
||||||
dependencies:
|
dependencies:
|
||||||
signing: signing-production
|
signing: signing-production
|
||||||
run:
|
run:
|
||||||
commands:
|
commands:
|
||||||
|
@ -60,7 +68,7 @@ jobs:
|
||||||
beta:
|
beta:
|
||||||
attributes:
|
attributes:
|
||||||
release-type: beta
|
release-type: beta
|
||||||
dependencies:
|
dependencies:
|
||||||
signing: signing-beta
|
signing: signing-beta
|
||||||
run:
|
run:
|
||||||
commands:
|
commands:
|
||||||
|
@ -68,4 +76,3 @@ jobs:
|
||||||
- [python, automation/taskcluster/upload_apk_nimbledroid.py, target.apk, .nimbledroid_token]
|
- [python, automation/taskcluster/upload_apk_nimbledroid.py, target.apk, .nimbledroid_token]
|
||||||
treeherder:
|
treeherder:
|
||||||
symbol: beta(nimbledroid)
|
symbol: beta(nimbledroid)
|
||||||
|
|
|
@ -32,6 +32,7 @@ gradlew_schema = Schema({
|
||||||
|
|
||||||
run_commands_schema = Schema({
|
run_commands_schema = Schema({
|
||||||
Required("using"): "run-commands",
|
Required("using"): "run-commands",
|
||||||
|
Optional("pre-commands"): [[text_type]],
|
||||||
Required("commands"): [[taskref_or_string]],
|
Required("commands"): [[taskref_or_string]],
|
||||||
Required("workdir"): text_type,
|
Required("workdir"): text_type,
|
||||||
Optional("use-caches"): bool,
|
Optional("use-caches"): bool,
|
||||||
|
@ -42,7 +43,8 @@ run_commands_schema = Schema({
|
||||||
@run_job_using("docker-worker", "run-commands", schema=run_commands_schema)
|
@run_job_using("docker-worker", "run-commands", schema=run_commands_schema)
|
||||||
def configure_run_commands_schema(config, job, taskdesc):
|
def configure_run_commands_schema(config, job, taskdesc):
|
||||||
run = job["run"]
|
run = job["run"]
|
||||||
pre_commands = [
|
pre_commands = run.pop("pre-commands", [])
|
||||||
|
pre_commands += [
|
||||||
_generate_secret_command(secret) for secret in run.get("secrets", [])
|
_generate_secret_command(secret) for secret in run.get("secrets", [])
|
||||||
]
|
]
|
||||||
all_commands = pre_commands + run.pop("commands", [])
|
all_commands = pre_commands + run.pop("commands", [])
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
# 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 nimbledroid
|
||||||
|
kind.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
|
from taskgraph.transforms.base import TransformSequence
|
||||||
|
from taskgraph.util.schema import resolve_keyed_by
|
||||||
|
|
||||||
|
|
||||||
|
transforms = TransformSequence()
|
||||||
|
|
||||||
|
|
||||||
|
@transforms.add
|
||||||
|
def resolve_keys(config, tasks):
|
||||||
|
for task in tasks:
|
||||||
|
for key in ("run.secrets", "run.pre-commands"):
|
||||||
|
resolve_keyed_by(
|
||||||
|
task,
|
||||||
|
key,
|
||||||
|
item_name=task["name"],
|
||||||
|
level=config.params["level"]
|
||||||
|
)
|
||||||
|
yield task
|
Loading…
Reference in New Issue