Bug 1363886 - Part 1: Check API function results against schema r=kmag
[gecko.git] / .taskcluster.yml
blob8ae42e1847ddfc1939b79fc49bb4b16c8404078c
1 # This file is rendered via JSON-e by
2 # - mozilla-taskcluster - https://docs.taskcluster.net/reference/integrations/mozilla-taskcluster/docs/taskcluster-yml
3 # - cron tasks - taskcluster/taskgraph/cron/decision.py
4 version: 1
5 tasks:
6   $let:
7     # sometimes the push user is just `ffxbld` or the like, but we want an email-like field..
8     ownerEmail: {$if: '"@" in push.owner', then: '${push.owner}', else: '${push.owner}@noreply.mozilla.org'}
9     # ensure there's no trailing `/` on the repo URL
10     repoUrl: {$if: 'repository.url[-1] == "/"', then: {$eval: 'repository.url[:-1]'}, else: {$eval: 'repository.url'}}
11   in:
12   - taskId: '${as_slugid("decision")}'
13     taskGroupId: '${as_slugid("decision")}' # same as tsakId; this is how automation identifies a decision tsak
14     schedulerId: 'gecko-level-${repository.level}'
16     created: {$fromNow: ''}
17     deadline: {$fromNow: '1 day'}
18     expires: {$fromNow: '1 year 1 second'} # 1 second so artifacts expire first, despite rounding errors
19     metadata:
20       $merge:
21         - owner: "${ownerEmail}"
22           source: "${repoUrl}/raw-file/${push.revision}/.taskcluster.yml"
23         - $if: 'tasks_for == "hg-push"'
24           then:
25             name: "Gecko Decision Task"
26             description: 'The task that creates all of the other tasks in the task graph'
27           else:
28             name: "Decision Task for cron job ${cron.job_name}"
29             description: 'Created by a [cron task](https://tools.taskcluster.net/tasks/${cron.task_id})'
31     provisionerId: "aws-provisioner-v1"
32     workerType: "gecko-decision"
34     tags:
35       $if: 'tasks_for == "hg-push"'
36       then: {createdForUser: "${ownerEmail}"}
38     routes:
39       $if: 'tasks_for == "hg-push"'
40       then:
41         - "index.gecko.v2.${repository.project}.latest.firefox.decision"
42         - "index.gecko.v2.${repository.project}.pushlog-id.${push.pushlog_id}.decision"
43         - "tc-treeherder.v2.${repository.project}.${push.revision}.${push.pushlog_id}"
44         - "tc-treeherder-stage.v2.${repository.project}.${push.revision}.${push.pushlog_id}"
45         - "notify.email.${ownerEmail}.on-failed"
46         - "notify.email.${ownerEmail}.on-exception"
47       else:
48         - "index.gecko.v2.${repository.project}.latest.firefox.decision-${cron.job_name}"
49         - "tc-treeherder.v2.${repository.project}.${push.revision}.${push.pushlog_id}"
50         - "tc-treeherder-stage.v2.${repository.project}.${push.revision}.${push.pushlog_id}"
52     scopes:
53       $if: 'tasks_for == "hg-push"'
54       then:
55         - 'assume:repo:${repoUrl[8:]}:*'
56         - 'queue:route:notify.email.${ownerEmail}.*'
57       else:
58         - 'assume:repo:${repoUrl[8:]}:cron:${cron.job_name}'
60     dependencies: []
61     requires: all-completed
63     priority: lowest
64     retries: 5
66     payload:
67       env:
68         # checkout-gecko uses these to check out the source; the inputs
69         # to `mach taskgraph decision` are all on the command line.
70         GECKO_BASE_REPOSITORY: 'https://hg.mozilla.org/mozilla-unified'
71         GECKO_HEAD_REPOSITORY: '${repoUrl}'
72         GECKO_HEAD_REF: '${push.revision}'
73         GECKO_HEAD_REV: '${push.revision}'
74         GECKO_COMMIT_MSG: '${push.comment}'
75         HG_STORE_PATH: /home/worker/checkouts/hg-store
77       cache:
78         level-${repository.level}-checkouts: /home/worker/checkouts
80       features:
81         taskclusterProxy: true
82         chainOfTrust: true
84       # Note: This task is built server side without the context or tooling that
85       # exist in tree so we must hard code the hash
86       # XXX Changing this will break Chain of Trust without an associated puppet and
87       # scriptworker patch!
88       image: 'taskcluster/decision:0.1.8@sha256:195d8439c8e90d59311d877bd2a8964849b2e43bfc6c234092618518d8b2891b'
90       maxRunTime: 1800
92       # TODO use mozilla-unified for the base repository once the tc-vcs
93       # tar.gz archives are created or tc-vcs isn't being used.
94       command:
95         - /home/worker/bin/run-task
96         - '--vcs-checkout=/home/worker/checkouts/gecko'
97         - '--'
98         - bash
99         - -cx
100         - $let:
101             extraArgs: {$if: 'tasks_for == "hg-push"', then: '', else: '${cron.quoted_args}'}
102           # NOTE: the explicit reference to mozilla-central below is required because android-stuff
103           # still uses tc-vcs, which does not support mozilla-unified
104           # https://bugzilla.mozilla.org/show_bug.cgi?id=1383973
105           in: >
106             cd /home/worker/checkouts/gecko &&
107             ln -s /home/worker/artifacts artifacts &&
108             ./mach --log-no-times taskgraph decision
109             --pushlog-id='${push.pushlog_id}'
110             --pushdate='${push.pushdate}'
111             --project='${repository.project}'
112             --message="$GECKO_COMMIT_MSG"
113             --owner='${ownerEmail}'
114             --level='${repository.level}'
115             --base-repository='https://hg.mozilla.org/mozilla-central'
116             --head-repository="$GECKO_HEAD_REPOSITORY"
117             --head-ref="$GECKO_HEAD_REF"
118             --head-rev="$GECKO_HEAD_REV"
119             ${extraArgs}
121       artifacts:
122         'public':
123           type: 'directory'
124           path: '/home/worker/artifacts'
125           expires: {$fromNow: '1 year'}
127     extra:
128       treeherder:
129         $if: 'tasks_for == "hg-push"'
130         then:
131           symbol: D
132         else:
133           groupSymbol: cron
134           symbol: "${cron.job_symbol}"