Bug 1274350 - Fix .taskcluster.yml file format for decision task r=me
authorTim Taubert <ttaubert@mozilla.com>
Tue, 24 May 2016 16:43:36 +0200
changeset 12187 baf356de3df1e93a61161a11b08696b06b9a7b83
parent 12186 9e4ca98a20203d7b2753be03f881590697006cf6
child 12188 de69b3477bb4d4a0fcc0801cd6bb0db522f1b542
push id1238
push userttaubert@mozilla.com
push dateTue, 24 May 2016 14:44:57 +0000
reviewersme
bugs1274350
Bug 1274350 - Fix .taskcluster.yml file format for decision task r=me
.taskcluster.yml
--- a/.taskcluster.yml
+++ b/.taskcluster.yml
@@ -1,58 +1,101 @@
 ---
+version: 0
 metadata:
   name: "NSS Continuous Integration"
-  description: "Build NSS and run tests in various configurations"
+  description: "The Taskcluster task graph for the NSS tree"
   owner: "mozilla-taskcluster-maintenance@mozilla.com"
-  source: "{{{source}}}"
+  source: {{{source}}}
+
+scopes:
+  # Note the below scopes are insecure however these get overriden on the server
+  # side to whatever scopes are set by mozilla-taskcluster.
+  - queue:*
+  - docker-worker:*
+  - scheduler:*
+
+# Available mustache parameters (see the mozilla-taskcluster source):
+#
+# - owner:          push user (email address)
+# - source:         URL of this YAML file
+# - url:            repository URL
+# - project:        alias for the destination repository (basename of
+#                   the repo url)
+# - level:          SCM level of the destination repository
+#                   (1 = try, 3 = core)
+# - revision:       (short) hg revision of the head of the push
+# - revision_hash:  (long) hg revision of the head of the push
+# - comment:        comment of the push
+# - pushlog_id:     id in the pushlog table of the repository
+#
+# and functions:
+# - as_slugid:      convert a label into a slugId
+# - from_now:       generate a timestamp at a fixed offset from now
 
 tasks:
-  - provisionerId: "aws-provisioner-v1"
-    workerType: "gecko-decision"
+  - taskId: '{{#as_slugid}}decision task{{/as_slugid}}'
+    reruns: 3
+    task:
+      created: '{{now}}'
+      deadline: '{{#from_now}}1 day{{/from_now}}'
+      expires: '{{#from_now}}14 days{{/from_now}}'
 
-    scopes:
-      - "queue:route:tc-treeherder-stage.nss.{{revision}}"
-      - "queue:route:tc-treeherder.nss.{{revision}}"
-      - "scheduler:extend-task-graph:*"
+      metadata:
+        owner: mozilla-taskcluster-maintenance@mozilla.com
+        source: {{{source}}}
+        name: "NSS Decision Task"
+        description: |
+            The task that creates all of the other tasks in the task graph
+
+      workerType: "gecko-decision"
+      provisionerId: "aws-provisioner-v1"
 
-    routes:
-      - "tc-treeherder-stage.nss.{{revision}}"
-      - "tc-treeherder.nss.{{revision}}"
+      tags:
+        createdForUser: {{owner}}
 
-    metadata:
-      name: "NSS Decision Task"
-      description: "Extends the task graph with everything we need"
-      owner: "mozilla-taskcluster-maintenance@mozilla.com"
-      source: "{{{source}}}"
-    tags:
-      createdForUser: {{owner}}
+      scopes:
+        - "queue:route:tc-treeherder-stage.nss.{{revision}}"
+        - "queue:route:tc-treeherder.nss.{{revision}}"
+        - "scheduler:extend-task-graph:*"
+        # mozilla-taskcluster will append the appropriate assume:repo:<repo>
+        # scope here.
+
+      routes:
+        - "tc-treeherder-stage.nss.{{revision_hash}}"
+        - "tc-treeherder.nss.{{revision_hash}}"
+
+      payload:
+        image: "ttaubert/nss-ci:0.0.13"
 
-    payload:
-      maxRunTime: 1800
-      image: "ttaubert/nss-ci:0.0.13"
-      command:
-        - bash
-        - -cx
-        - >
-          bin/checkout.sh &&
-          nss/automation/taskcluster/scripts/extend_task_graph.sh
-      env:
-        TC_DOCKER_IMAGE: "ttaubert/nss-ci:0.0.13"
-        TC_PROVISIONER_ID: "aws-provisioner-v1"
-        TC_WORKER_TYPE: "hg-worker"
-        NSS_HEAD_REPOSITORY: '{{{url}}}'
-        NSS_HEAD_REVISION: '{{revision}}'
+        env:
+          TC_DOCKER_IMAGE: "ttaubert/nss-ci:0.0.13"
+          TC_PROVISIONER_ID: "aws-provisioner-v1"
+          TC_WORKER_TYPE: "hg-worker"
+          NSS_HEAD_REPOSITORY: '{{{url}}}'
+          NSS_HEAD_REVISION: '{{revision}}'
+
+        features:
+          taskclusterProxy: true
+
+        maxRunTime: 1800
 
-      graphs:
-        - /home/worker/artifacts/graph.json
+        command:
+          - bash
+          - -cx
+          - >
+            bin/checkout.sh &&
+            nss/automation/taskcluster/scripts/extend_task_graph.sh
 
-      artifacts:
-        public:
-          type: "directory"
-          path: "/home/worker/artifacts"
-          expires: "{{#from_now}}1 hour{{/from_now}}"
+        artifacts:
+          public:
+            type: "directory"
+            path: "/home/worker/artifacts"
+            expires: "{{#from_now}}7 days{{/from_now}}"
 
-    extra:
-      treeherder:
-        symbol: D
-        revision: '{{revision}}'
-        revision_hash: '{{revision_hash}}'
+        graphs:
+          - /home/worker/artifacts/graph.json
+
+      extra:
+        treeherder:
+          symbol: D
+          revision: '{{revision}}'
+          revision_hash: '{{revision_hash}}'