-
Notifications
You must be signed in to change notification settings - Fork 15
/
cron-task-template.yml
75 lines (73 loc) · 2.57 KB
/
cron-task-template.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
---
# This is the template for the task definition for cron task hooks. Its job is
# to run a `mach cron` in a decision-task image; that command will take care of
# the details.
#
# This is parsed with JSON-e. The context values are;
# - level -- SCM level
# - hookGroupId / hookId -- hook identifiers
# - repo_env -- repository-related env vars
# - checkout_options -- list of options to run-task to check out the repo
# - project_repo -- repository URL
# - alias -- project alias
# - cron_options -- cron options (as a string)
# - trim_whitespace(..) -- trim newlines and extra whitespace in a command string
# - taskcluster_root_url -- the rootUrl for this TC deployment
#
# Note that aside from the task times as noted below, the JSON-e rendering performed
# when the hook is fired does not supply any additional information.
provisionerId: infra
workerType: build-decision
schedulerId: ${trust_domain}-level-${level}
# The "$fromNow" options here are escaped so that they are processed by the hooks service's
# JSON-e rendering when the hook is fired.
deadline: {$$fromNow: 1 hour}
expires: {$$fromNow: 7 days}
routes:
$map: {$eval: cron_notify_emails}
each(entry): notify.email.${entry.to_address}.${entry.on_event}
scopes:
- assume:hook-id:${hookGroupId}/${hookId}
payload:
# built by pushes to the fxci-config repository
image: mozillareleases/build-decision:d9b4a81d8e114107d174994bf6be3968b34ca0db@sha256:5b1d21483c08c0698dd7f0b41f99482277375de5e5304ada1ad9d927d3899d7d
env:
$merge:
- $if: allow_input
then:
# pass along the hook payload
HOOK_PAYLOAD: {$$json: {$$eval: payload}}
command:
$flatten:
- cron
- --repo-url
- ${project_repo}
- --project
- ${alias}
- --level
- ${level}
- --repository-type
- ${repo_type}
- $if: branch
then:
- --branch
- ${branch}
- --trust-domain
- ${trust_domain}
- {$eval: cron_options}
features:
taskclusterProxy: true
chainOfTrust: true
# If this task does not succeed immediately, something is probably wrong. We
# want to avoid a storm of decision tasks when that problem is resolved, so
# we are conservative with the time it can possibly retry.
maxRunTime: 600
metadata:
owner: [email protected]
source: https://firefox-ci-tc.services.mozilla.com/hooks/#${hookGroupId}/${hookId}
description: See https://firefox-ci-tc.services.mozilla.com/hooks/#${hookGroupId}/${hookId}
name: Cron task for ${project_repo}
priority: normal
retries: 5
tags: {}
extra: {}