1---
2version: 0
3metadata:
4  name: 'Taskcluster tasks for Gecko'
5  description: "The taskcluster task graph for Gecko trees"
6  owner: mozilla-taskcluster-maintenance@mozilla.com
7  source: {{{source}}}
8
9scopes:
10  # Note the below scopes are insecure however these get overriden on the server
11  # side to whatever scopes are set by mozilla-taskcluster.
12  - queue:*
13  - docker-worker:*
14  - scheduler:*
15
16# Available mustache parameters (see the mozilla-taskcluster source):
17#
18# - owner:          push user (email address)
19# - source:         URL of this YAML file
20# - url:            repository URL
21# - project:        alias for the destination repository (basename of
22#                   the repo url)
23# - level:          SCM level of the destination repository
24#                   (1 = try, 3 = core)
25# - revision:       (short) hg revision of the head of the push
26# - revision_hash:  (long) hg revision of the head of the push
27# - comment:        comment of the push
28# - pushlog_id:     id in the pushlog table of the repository
29#
30# and functions:
31# - as_slugid:      convert a label into a slugId
32# - from_now:       generate a timestamp at a fixed offset from now
33
34# The resulting tasks' taskGroupId will be equal to the taskId of the first
35# task listed here, which should be the decision task.  This gives other tools
36# an easy way to determine the ID of the decision task that created a
37# particular group.
38
39tasks:
40  - taskId: '{{#as_slugid}}decision task{{/as_slugid}}'
41    task:
42      created: '{{now}}'
43      deadline: '{{#from_now}}1 day{{/from_now}}'
44      expires: '{{#from_now}}365 day{{/from_now}}'
45      metadata:
46        owner: mozilla-taskcluster-maintenance@mozilla.com
47        source: {{{source}}}
48        name: "Gecko Decision Task"
49        description: |
50            The task that creates all of the other tasks in the task graph
51
52      workerType: "gecko-decision"
53      provisionerId: "aws-provisioner-v1"
54
55      tags:
56        createdForUser: {{owner}}
57
58      scopes:
59        # Bug 1269443: cache scopes, etc. must be listed explicitly
60        - "docker-worker:cache:level-{{level}}-*"
61        - "docker-worker:cache:tooltool-cache"
62        # mozilla-taskcluster will append the appropriate assume:repo:<repo>
63        # scope here.
64
65      routes:
66        - "index.gecko.v2.{{project}}.latest.firefox.decision"
67        - "index.gecko.v2.{{project}}.latest.taskgraph.decision"
68        - "tc-treeherder.v2.{{project}}.{{revision}}.{{pushlog_id}}"
69        - "tc-treeherder-stage.v2.{{project}}.{{revision}}.{{pushlog_id}}"
70
71      payload:
72        env:
73          # checkout-gecko uses these to check out the source; the inputs
74          # to `mach taskgraph decision` are all on the command line.
75          GECKO_BASE_REPOSITORY: 'https://hg.mozilla.org/mozilla-unified'
76          GECKO_HEAD_REPOSITORY: '{{{url}}}'
77          GECKO_HEAD_REF: '{{revision}}'
78          GECKO_HEAD_REV: '{{revision}}'
79          HG_STORE_PATH: /home/worker/checkouts/hg-store
80
81        cache:
82          level-{{level}}-checkouts: /home/worker/checkouts
83
84        features:
85          taskclusterProxy: true
86          chainOfTrust: true
87
88        # Note: This task is built server side without the context or tooling that
89        # exist in tree so we must hard code the version
90        image: 'taskcluster/decision:0.1.7'
91
92        maxRunTime: 1800
93
94        # TODO use mozilla-unified for the base repository once the tc-vcs
95        # tar.gz archives are created or tc-vcs isn't being used.
96        command:
97          - /home/worker/bin/run-task
98          - '--vcs-checkout=/home/worker/checkouts/gecko'
99          - '--'
100          - bash
101          - -cx
102          - >
103              cd /home/worker/checkouts/gecko &&
104              ln -s /home/worker/artifacts artifacts &&
105              ./mach --log-no-times taskgraph decision
106              --pushlog-id='{{pushlog_id}}'
107              --pushdate='{{pushdate}}'
108              --project='{{project}}'
109              --message={{#shellquote}}{{{comment}}}{{/shellquote}}
110              --owner='{{owner}}'
111              --level='{{level}}'
112              --base-repository='https://hg.mozilla.org/mozilla-central'
113              --head-repository='{{{url}}}'
114              --head-ref='{{revision}}'
115              --head-rev='{{revision}}'
116              --revision-hash='{{revision_hash}}'
117
118        artifacts:
119          'public':
120            type: 'directory'
121            path: '/home/worker/artifacts'
122            expires: '{{#from_now}}364 days{{/from_now}}'
123
124      extra:
125        treeherder:
126          symbol: D
127