.taskcluster.yml (7790B)
1 # yamllint disable rule:line-length 2 # This file is rendered via JSON-e in a hook with context: 3 # { 4 # tasks_for: 'hg-push', 5 # push: {owner, pushlog_id, pushdate}, 6 # repository: {url, project, level}, 7 # now, 8 # ownTaskId: // taskId of the task that will be created 9 # } 10 --- 11 version: 1 12 tasks: 13 # NOTE: support for actions in ci-admin requires that the `tasks` property be 14 # an array *before* JSON-e rendering takes place. 15 - $if: 'tasks_for in ["hg-push", "action"]' 16 then: 17 $let: 18 # sometimes the push user is just `ffxbld` or the like, but we want an 19 # email-like field.. 20 ownerEmail: 21 $if: '"@" in push.owner' 22 then: '${push.owner}' 23 else: '${push.owner}@noreply.mozilla.org' 24 # ensure there's no trailing `/` on the repo URL 25 repoUrl: 26 $if: 'repository.url[-1] == "/"' 27 then: {$eval: 'repository.url[:-1]'} 28 else: {$eval: 'repository.url'} 29 trustDomain: nss 30 treeherder_link: '[Treeherder job](https://treeherder.mozilla.org/#/jobs?repo=${repository.project}&revision=${push.revision}&selectedTaskRun=${ownTaskId})' 31 expires: {$fromNow: '14 days'} 32 in: 33 taskId: {$if: 'tasks_for != "action"', then: '${ownTaskId}'} 34 taskGroupId: 35 $if: 'tasks_for == "action"' 36 then: '${action.taskGroupId}' 37 else: '${ownTaskId}' 38 schedulerId: 'nss-level-${repository.level}' 39 created: {$fromNow: ''} 40 deadline: {$fromNow: '1 day'} 41 expires: {$eval: 'expires'} 42 43 metadata: 44 $merge: 45 - owner: mozilla-taskcluster-maintenance@mozilla.com 46 source: "${repoUrl}/raw-file/${push.revision}/.taskcluster.yml" 47 - $if: 'tasks_for == "hg-push"' 48 then: 49 name: "NSS Decision Task" 50 description: The task that creates all of the other tasks in the task graph 51 else: 52 name: "Action: ${action.title}" 53 description: | 54 ${action.description} 55 56 ${treeherder_link} 57 58 Action triggered by clientID `${clientId}` 59 60 provisionerId: "${trustDomain}-${repository.level}" 61 workerType: "decision" 62 63 tags: 64 $if: 'tasks_for == "hg-push"' 65 then: 66 createdForUser: "${ownerEmail}" 67 kind: decision-task 68 else: 69 createdForUser: '${ownerEmail}' 70 kind: action-callback 71 72 73 routes: 74 $flattenDeep: 75 - "tc-treeherder.v2.${repository.project}.${push.revision}" 76 - $if: 'tasks_for == "hg-push"' 77 then: 78 - "index.${trustDomain}.v2.${repository.project}.latest.taskgraph.decision" 79 - "index.${trustDomain}.v2.${repository.project}.revision.${push.revision}.taskgraph.decision" 80 - "index.${trustDomain}.v2.${repository.project}.pushlog-id.${push.pushlog_id}.decision" 81 else: 82 - "index.${trustDomain}.v2.${repository.project}.revision.${push.revision}.taskgraph.actions.${ownTaskId}" 83 - "index.${trustDomain}.v2.${repository.project}.pushlog-id.${push.pushlog_id}.actions.${ownTaskId}" 84 85 scopes: 86 $if: 'tasks_for == "hg-push"' 87 then: 88 - 'assume:repo:${repoUrl[8:]}:branch:default' 89 - 'in-tree:hook-action:project-${trustDomain}/in-tree-action-${repository.level}-*' 90 - 'index:insert-task:${trustDomain}.v2.${repository.project}.*' 91 else: 92 - '${action.repo_scope}' 93 94 dependencies: [] 95 requires: all-completed 96 97 priority: low 98 retries: 0 99 100 payload: 101 image: mozillareleases/taskgraph:decision-v14.2.1@sha256:f4e3a22df9ec0017a2534b3a7b4cd9b60318f86619e0c2156c12c1ec1a0e32cb 102 103 env: 104 $merge: 105 - NSS_BASE_REPOSITORY: 'https://hg.mozilla.org/projects/nss' 106 NSS_REPOSITORY_TYPE: 'hg' 107 NSS_BASE_REV: '${push.base_revision}' 108 NSS_HEAD_REPOSITORY: '${repository.url}' 109 NSS_HEAD_REV: '${push.revision}' 110 HG_STORE_PATH: /builds/worker/checkouts/hg-store 111 TASKCLUSTER_CACHES: /builds/worker/checkouts 112 REPOSITORIES: {$json: {nss: NSS}} 113 - $if: 'tasks_for == "action"' 114 then: 115 ACTION_TASK_GROUP_ID: '${action.taskGroupId}' 116 ACTION_TASK_ID: {$json: {$eval: 'taskId'}} 117 ACTION_INPUT: {$json: {$eval: 'input'}} 118 ACTION_CALLBACK: '${action.cb_name}' 119 120 cache: 121 "${trustDomain}-level-${repository.level}-checkouts-sparse-v3": /builds/worker/checkouts 122 123 maxRunTime: 1800 124 125 command: 126 - /usr/local/bin/run-task 127 - '--nss-checkout=/builds/worker/checkouts/nss' 128 - '--' 129 - bash 130 - -cx 131 - $if: 'tasks_for == "action"' 132 then: > 133 cd /builds/worker/checkouts/nss && 134 ln -s /builds/worker/artifacts artifacts && 135 taskgraph action-callback 136 else: > 137 cd /builds/worker/checkouts/nss && 138 ln -s /builds/worker/artifacts artifacts && 139 taskgraph decision 140 --pushlog-id='${push.pushlog_id}' 141 --pushdate='${push.pushdate}' 142 --project='${repository.project}' 143 --owner='${ownerEmail}' 144 --level='${repository.level}' 145 --tasks-for='${tasks_for}' 146 --repository-type=hg 147 --base-repository="$NSS_BASE_REPOSITORY" 148 --base-rev="$NSS_BASE_REV" 149 --head-repository="$NSS_HEAD_REPOSITORY" 150 --head-ref="$NSS_HEAD_REF" 151 --head-rev="$NSS_HEAD_REV" 152 153 features: 154 taskclusterProxy: true 155 156 artifacts: 157 'public': 158 type: 'directory' 159 path: '/builds/worker/artifacts' 160 expires: {$eval: expires} 161 'public/docker-contexts': 162 type: 'directory' 163 path: '/builds/worker/checkouts/nss/docker-contexts' 164 # This needs to be at least the deadline of the 165 # decision task + the docker-image task deadlines. 166 # It is set to a week to allow for some time for 167 # debugging, but they are not useful long-term. 168 expires: {$fromNow: '7 day'} 169 170 extra: 171 $merge: 172 - treeherder: 173 $merge: 174 - machine: 175 platform: nss-decision 176 - $if: 'tasks_for == "hg-push"' 177 then: 178 symbol: D 179 else: 180 groupName: 'action-callback' 181 groupSymbol: 'AC' 182 symbol: "${action.symbol}" 183 - $if: 'tasks_for == "action"' 184 then: 185 parent: '${action.taskGroupId}' 186 action: 187 name: '${action.name}' 188 context: 189 taskGroupId: '${action.taskGroupId}' 190 taskId: {$eval: 'taskId'} 191 input: {$eval: 'input'} 192 clientId: {$eval: 'clientId'} 193 - tasks_for: '${tasks_for}' 194 - $if: 'tasks_for == "hg-push"' 195 then: 196 notify: 197 email: 198 $merge: 199 - link: 200 text: "Treeherder Jobs" 201 href: "https://treeherder.mozilla.org/#/jobs?repo=${repository.project}&revision=${push.revision}"