-
Notifications
You must be signed in to change notification settings - Fork 12
/
hg-push-template.yml
78 lines (75 loc) · 2.89 KB
/
hg-push-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
76
77
78
---
# This is the template for the task definition for hg push hooks. Its job is
# to run a decision task for the given revision of the given repository.
#
# This is rendered with JSON-e to create a JSON-e task template in a hook,
# meaning that the content of this file is rendered *twice* with JSON-e. The
# context values for the first rendering are;
#
# - level -- SCM level
# - trust_domain -- project's trust domain
# - hookGroupId / hookId -- hook identifiers
# - project_repo -- repository URL
# - project_repo_path -- path portion of the repository URL
# - alias -- project alias
#
# Uses of `$${..}` and `$$..: ..` are intended to occur in the second rendering.
# The context for the second rendering is that provided by the hooks service in response
# to a Pulse message from exchange/hgpushes/v2 or a triggerHook call with the same payload
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: 30 minutes}
expires: {$$fromNow: 3 days}
scopes:
- assume:${project_role_prefix}:branch:*
routes:
- index.hg-push.v1.${alias}.revision.$${payload.payload.data.heads[0]}
- index.hg-push.v1.${alias}.pushlog-id.$${payload.payload.data.pushlog_pushes[0].pushid}
payload:
# built by pushes to the fxci-config repository
image: mozillareleases/build-decision:d9b4a81d8e114107d174994bf6be3968b34ca0db@sha256:5b1d21483c08c0698dd7f0b41f99482277375de5e5304ada1ad9d927d3899d7d
env:
# pass along the hook payload, which is the Pulse message from hg (v2)
# https://mozilla-version-control-tools.readthedocs.io/en/latest/hgmo/notifications.html#pulse-notifications
PULSE_MESSAGE: {$$json: {$$eval: payload}}
command:
$flatten:
- hg-push
# hard-coded values that can't be changed by the hook payload
- --repo-url
- ${project_repo}
- --project
- ${alias}
- --level
- ${level}
- --trust-domain
- ${trust_domain}
- --repository-type
- hg
- $if: taskcluster_yml_repo
then:
- --taskcluster-yml-repo
- ${taskcluster_yml_repo}
features:
taskclusterProxy: 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:
$$let:
description:
$$if: firedBy == "triggerHook"
then: Fired by triggerHook call from $${clientId}
else: Fired by $${firedBy}
in:
owner: [email protected]
source: https://firefox-ci-tc.services.mozilla.com/hooks/${hookGroupId}/${hookId}
description: $${description}
name: On-Push task for ${project_repo}
priority: highest
retries: 5
tags: {}
extra: {}