summaryrefslogtreecommitdiff
path: root/.taskcluster.yml
blob: 05bade9656e8a8dcbfe5c7ceede7e6cd082fc36e (plain)
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
79
80
81
82
83
84
# This file is rendered via JSON-e in a hook with context:
#   {
#     tasks_for: 'hg-push',
#     push: {owner, pushlog_id, pushdate},
#     repository: {url, project, level},
#     now,
#     ownTaskId: // taskId of the task that will be created
#   }
---
version: 1
tasks:
  - $let:
      # sometimes the push user is just `ffxbld` or the like, but we want an
      # email-like field..
      ownerEmail:
        $if: '"@" in push.owner'
        then: '${push.owner}'
        else: '${push.owner}@noreply.mozilla.org'
      # ensure there's no trailing `/` on the repo URL
      repoUrl:
        $if: 'repository.url[-1] == "/"'
        then: {$eval: 'repository.url[:-1]'}
        else: {$eval: 'repository.url'}
      # scheduler id
      schedulerId: 'nss-level-${repository.level}'
    in:
      taskId: '${ownTaskId}'
      taskGroupId: '${ownTaskId}'
      schedulerId: '${schedulerId}'
      created: {$fromNow: ''}
      deadline: {$fromNow: '1 day'}
      expires: {$fromNow: '14 days'}

      metadata:
        owner: mozilla-taskcluster-maintenance@mozilla.com
        source: "${repository.url}"
        name: "NSS Decision Task"
        description: |
            The task that creates all of the other tasks in the task graph

      workerType: "hg-worker"
      provisionerId: "aws-provisioner-v1"

      scopes:
        - 'assume:repo:${repoUrl[8:]}:branch:default'
      tags:
        createdForUser: "${ownerEmail}"

      routes:
        - "tc-treeherder-stage.v2.${repository.project}.${push.revision}.${push.pushlog_id}"
        - "tc-treeherder.v2.${repository.project}.${push.revision}.${push.pushlog_id}"

      payload:
        # TODO: use nssdev org , not djmitche, once the image is pushed there
        image: djmitche/nss-decision:0.0.3

        env:
          TC_OWNER: "${ownerEmail}"
          TC_SOURCE: "${repository.url}"
          TC_PROJECT: ${repository.project}
          TC_SCHEDULER_ID: "${schedulerId}"
          NSS_PUSHLOG_ID: '${push.pushlog_id}'
          NSS_HEAD_REPOSITORY: '${repository.url}'
          NSS_HEAD_REVISION: '${push.revision}'

        maxRunTime: 1800

        command:
          - bash
          - -cx
          - >
            bin/checkout.sh &&
            nss/automation/taskcluster/scripts/extend_task_graph.sh

        features:
          taskclusterProxy: true

      extra:
        treeherder:
          symbol: D
          build:
            platform: nss-decision
          machine:
            platform: nss-decision